3 messages in ru.sysoev.nginxRe: windows 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 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: windows static assets - solvedActions...
From:Chris Cortese (cort@gmail.com)
Date:May 14, 2009 11:38:38 pm
List:ru.sysoev.nginx

Actually that does work. Now I'm stumped as to what was the original problem because I'm pretty sure I had that at one point. At least it's solved now.

Igor Sysoev wrote:

On Thu, May 14, 2009 at 06:33:59PM -0700, Chris Cortese wrote:

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).

Actually in nginx/Windows root is relative to the directory where nginx was run.

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

Does not this work:

root C:/cygwin/home/Chris/www/live/jobsite/trunk/html/public;

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; } }