Static Files not serving

Igor Sysoev is at rambler-co.ru
Tue Feb 12 10:49:14 MSK 2008


On Mon, Feb 11, 2008 at 11:40:46PM -0800, Dave Dash wrote:

> I have an nginx conf as such:
> 
> 
> server {
>         listen   80;
>         server_name onyxfoundation.org;
>         access_log  /var/log/nginx/onyx.access.log;
>         error_log /var/log/nginx/onyx.error.log;
> 
>         location /static {
>                 root   /var/www/django/onyx/static;

Look in error_log. Probably, you should do

-                 root   /var/www/django/onyx/static;
+                 root   /var/www/django/onyx;

>                 access_log   off;
>                 expires      30d;
>         }
> 
>         location / {
>                 # host and port to fastcgi server
>                 fastcgi_pass 127.0.0.1:3000;
>                 fastcgi_param PATH_INFO $fastcgi_script_name;
>                 fastcgi_param REQUEST_METHOD $request_method;
>                 fastcgi_param QUERY_STRING $query_string;
>                 fastcgi_param SERVER_NAME $server_name;
>                 fastcgi_param SERVER_PORT $server_port;
>                 fastcgi_param SERVER_PROTOCOL $server_protocol;
>                 fastcgi_param CONTENT_TYPE $content_type;
>                 fastcgi_pass_header Authorization;
>                 fastcgi_intercept_errors off;
>         }
> }
> 
> 
> But none of my static assets are being served.  They get a 404  
> error.  Is their something I'm missing, I tried location ^~ /static  
> as well and that didn't work.


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list