atom feed3 messages in ru.sysoev.nginxwindows static assets - solved
FromSent OnAttachments
Chris CorteseMay 14, 2009 6:33 pm 
Igor SysoevMay 14, 2009 10:13 pm 
Chris CorteseMay 14, 2009 11:38 pm 
Subject:windows static assets - solved
From:Chris Cortese (cort@gmail.com)
Date:May 14, 2009 6:33:36 pm
List:ru.sysoev.nginx

I finally found the solution to my problem with getting 404 on static assets (/images, /js, /css).

Not sure how I missed it before but I saw the problem in the error log now. Basically I was not understanding that the root path needed to be relative to the location of the nginx.exe (c:\nginx\nginx.exe).

Changing "/cygwin/..." to "../cygwin/..." was my solution. I didn't have a problem with the non-static stuff (PHP) because all of that was handled by fastcgi, which expected the full windows path ("c:/cygwin/..."). Below is my working config.

server { listen *:80; server_name jobsite.xpdesktop;

access_log logs/jobsite.access.log; error_log logs/jobsite.error.log;

root ../cygwin/home/Chris/www/live/jobsite/trunk/html/public; # this was the fix index index.php index.html;

# serve static files directly location ~* ^.+\.(jpg|jpeg|gif|css|png|js|ico|pdf|zip|tar|gz|bz|bz2)$ { }

location / { fastcgi_pass 127.0.0.1:9000; fastcgi_param SCRIPT_FILENAME c:/cygwin/home/Chris/www/live/jobsite/trunk/html/public/index.php; fastcgi_param QUERY_STRING q=$request_uri; include fastcgi_params; }

location ~ /.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME c:/cygwin/home/Chris/www/live/jobsite/trunk/html/public$fastcgi_script_name; fastcgi_param QUERY_STRING q=$request_uri; include fastcgi_params; }

location = /css/style.php { fastcgi_pass 127.0.0.1:9000; fastcgi_param SCRIPT_FILENAME c:/cygwin/home/Chris/www/live/jobsite/trunk/html/public/css/style.php; include fastcgi_params; } }