2012-07-31 3 views
0

Windows에서 zend 프레임 워크를 사용하여 로컬 개발을위한 nginx + php 웹 서버를 설정하고 있습니다. 일반적으로 각 프로젝트의 www 루트에 새 폴더를 만든 다음 프로젝트 재 작성을위한 conf 파일을 만듭니다.다중 젠드 프로젝트가있는 Nginx

여기서 오류는 정적 콘텐츠에 액세스 할 수 없다는 것입니다. 내가 이미지 파일이나 CSS를 열려고하면 500 오류가 발생합니다. 그리고 나는 또한 내 프로젝트 conf가 100 % 정확하지는 않다. : \

내가 도와 줄 수 있니? 예를 들어 프로젝트의 conf

location /zproject { 
    root www/zproject; 
    try_files $uri $uri/ /zproject/index.php$is_args$args; 
} 

-----

worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; keepalive_timeout 65; gzip on; upstream php { server localhost:8993; server localhost:8994; server localhost:8995; server localhost:8996; server localhost:8997; } server { listen *; server_name_in_redirect off; charset utf-8; location/{ root www; index index.php index.html index.htm; } error_page 404 /404.html; location = /404.html { } location ~ \.php$ { root www; try_files $uri =404; fastcgi_pass php; include fastcgi.conf; } location ~ /\.ht { deny all; } include sites/*.conf; } } 

nginx.conf

fastcgi.conf

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
fastcgi_param QUERY_STRING  $query_string; 
fastcgi_param REQUEST_METHOD  $request_method; 
fastcgi_param CONTENT_TYPE  $content_type; 
fastcgi_param CONTENT_LENGTH  $content_length; 

fastcgi_param SCRIPT_NAME  $fastcgi_script_name; 
fastcgi_param REQUEST_URI  $request_uri; 
fastcgi_param DOCUMENT_URI  $document_uri; 
fastcgi_param DOCUMENT_ROOT  $document_root; 
fastcgi_param SERVER_PROTOCOL $server_protocol; 
fastcgi_param HTTPS    $https if_not_empty; 

fastcgi_param GATEWAY_INTERFACE CGI/1.1; 
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; 

fastcgi_param REMOTE_ADDR  $remote_addr; 
fastcgi_param REMOTE_PORT  $remote_port; 
fastcgi_param SERVER_ADDR  $server_addr; 
fastcgi_param SERVER_PORT  $server_port; 
fastcgi_param SERVER_NAME  $server_name; 

# PHP only, required if PHP was built with --enable-force-cgi-redirect 
fastcgi_param REDIRECT_STATUS 200; 

:

이러한 내 conf의 파일입니다 업데이트 (commment로부터 요청) access.log의

127.0.0.1부터

- - [31/7월/2012 : 11 : 15 : 46 +0100] "GET/zproject/콘텐츠/파일/팩 .png HTTP/1.1 "404 43648 "http://localhost/zproject""Mozilla/5.0 (Windows NT 6.1; 도마뱀 등 WOW64) AppleWebKit/536.11 (KHTML) 크롬/20.0.1132.57 사파리/536.11 "

에서는 error.log

2012년 7월 31일 11시 15분 46초 [오류로부터 ] 53696 # 53724 : * 5 CreateFile() "D : \ webserver/html/zproject/content/files/packs.png"실패 (3 : 시스템 에서 지정된 경로를 찾을 수 없음), 클라이언트 : 127.0.0.1, 서버 :, 요청 : "/zproject/content/files/packs.png HTTP/1.1 가져 오기", 호스트 : "localhost", 참조 자 : "http://localhost/zproject"

내가 볼 수있는 한, 그가 잘못된 위치에있는 파일을 찾고있는 것 같습니다. packs.png의 올바른 위치는 "D : \ webserver/www/zproject/content/files/packs.png"이며 "D : \ webserver/html/...."이 아닙니다.

+0

nginx 오류 로그가 있습니까? –

+0

@JamesButler가 주요 질문에 로그로 업데이트되었습니다 :) – MGP

답변

0

다음과 같이 추가하면됩니다 : root "D : \ webserver \ www"; 주 서버 구성으로. 모든 것이 의도대로 작동하는 것 같습니다 :)

관련 문제