2012-06-16 3 views
22

방금 ​​전에 약 1 시간 전에 nginx와 php fastcgi를 설치했고, 빠른 시작 구성 예제와 nginx 문서 등을 읽은 후에는 작동하지 않습니다.nginx가 localhost로 올바르게 구성 되었습니까?

나는 무엇을 바꾸 든 시도하든 항상 "Welcome to Nginx!"를 얻습니다.

(코멘트에 물건 내가 밖으로 시도 것입니다)

// default nginx stuff (unchanged) 

server { 
    #listen 80 default_server; 
    #listen 80 default; 
    listen 80; 

    #server_name localhost; 
    #server_name _; 

    #access_log /var/log/nginx/board.access_log; 
    #error_log /var/log/nginx/board.error_log; 

    #root /var/www/board; 
    #root /var/www/board/public/; 
    root /var/www/board/public; 

    #index index.html; 
    index index.html index.htm index.php; 
} 

경우 : 심지어 간단한 index.html을에게

내 설정을 호출하지 못할 - "로컬 호스트/..."화면 나는 그것을 이해한다. 이것은 가장 쉬운 셋업이어야한다, 그렇지? , 수 만 listen 80;index index.html;를 정의하지만, 난 그냥 문이 안 열려는 파일 /var/www/board/public/index.html이 존재하고 내가 뭔가를 시도 2 ​​시간을 더 낭비하기 전에 내용

있다

작동하도록 누군가 당신에게 빠른 시계를주고 내가 뭘 잘못하고 있는지 말해 주시겠습니까? 감사.

답변

25

기본적으로 nginx가 URL을 리소스와 바인딩하는 데 사용하는 위치를 선언하지 않았습니다. 그래서 서버 _ 로컬 호스트가 이미 시도했다 - - 내가 밖으로 시도 무엇을 '주석'라인 밝혔다 -

server { 
      listen  80; 
      server_name localhost; 

      access_log logs/localhost.access.log main; 

      location/{ 
       root /var/www/board/public; 
       index index.html index.htm index.php; 
      } 
     } 
+0

글쎄, 내가했다하지만 난 당신의 설치를 다시 시도주의 @Katai 분에게 나에게 – Katai

+0

을주지 'location/{'이것은 주요한 문제입니다 ... –

+0

http://wiki.nginx.org/Pitfalls 때문에'location/{}'의'루트'와'인덱스'는 없었습니다. – Katai

관련 문제