May 15, 2009 01:13AM
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;
> }
> }
>

--
Igor Sysoev
http://sysoev.ru/en/
Subject Author Posted

static images 404 on Windows

Chris Cortese May 09, 2009 04:25AM

Re: static images 404 on Windows

坏人 May 11, 2009 11:31PM

Re: static images 404 on Windows

Chris Cortese May 11, 2009 11:51PM

Re: static images 404 on Windows

raptium May 12, 2009 12:04AM

Re: static images 404 on Windows

Chris Cortese May 12, 2009 12:17AM

Re: static images 404 on Windows

凌晨 May 11, 2009 11:57PM

Re: static images 404 on Windows

raptium May 12, 2009 12:30AM

Re: static images 404 on Windows

Chris Cortese May 12, 2009 12:36AM

Re: static images 404 on Windows

Igor Sysoev May 12, 2009 02:13AM

Re: static images 404 on Windows

Chris Cortese May 12, 2009 03:16AM

Re: static images 404 on Windows

Igor Sysoev May 12, 2009 03:18AM

Re: static images 404 on Windows

Chris Cortese May 14, 2009 05:58PM

Re: static images 404 on Windows

Igor Sysoev May 15, 2009 01:10AM

Re: static images 404 on Windows

坏人 May 12, 2009 03:56AM

Re: static images 404 on Windows

Igor Sysoev May 12, 2009 04:15AM

答复: static images 404 on Windows

kevin May 12, 2009 05:42AM

windows static assets - solved

Chris Cortese May 14, 2009 09:33PM

Re: windows static assets - solved

Igor Sysoev May 15, 2009 01:13AM

Re: windows static assets - solved

Chris Cortese May 15, 2009 02:39AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 267
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready