EDIT: After thinking about this further I realized that my static.site.com logs were showing 1.0 hits which means they were going through the proxy. I changed my config to include a new server static.site.com and now it appears that nginx is serving my static files.
I just set up nginx reverse proxy and here is my config
Code:
location / {
proxy_pass http://127.0.0.1:8080/;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_max_temp_file_size 0;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
}
location /assets {
root /var/www/site.com/htdocs/;
}
I also have a subdomain at static.site.com where I have images stored.
From the logs of nginx it looks like it is serving everything including pages. This I know just isn't possible because I don't have any rewrites setup or fastcgi installed so it must be sending it to the proxy apache server.
But my question comes from nginx serving the files from static.site.com when it isn't set up to do that. How does that work? or is apache serving them and just not including it in the logs? My apache access log just shows access to the PHP files.
Thanks,
Gullah
nginx.log
Code:
*.*.*.* - - [26/Feb/2009:22:12:15 -0600] "GET /assets/js/public/jquery.js$
*.*.*.* - - [26/Feb/2009:22:12:15 -0600] "GET /assets/js/public/unravel.m$
*.*.*.* - - [26/Feb/2009:22:12:15 -0600] "GET /assets/images/public/logo.$
*.*.*.* - - [26/Feb/2009:22:12:16 -0600] "GET /artists/Beck/Beck_thumb.jp$
*.*.*.* - - [26/Feb/2009:22:12:16 -0600] "GET /users/drew.PNG HTTP/1.1" 2$
*.*.*.* - - [26/Feb/2009:22:14:11 -0600] "GET /home/index HTTP/1.1" 200 4$
apache.log
Code:
127.0.0.1 - - [26/Feb/2009:22:12:01 -0600] "GET /home/index HTTP/1.0" 200 4394 $
127.0.0.1 - - [26/Feb/2009:22:12:14 -0600] "GET /home/index HTTP/1.0" 200 4394 $
127.0.0.1 - - [26/Feb/2009:22:14:11 -0600] "GET /home/index HTTP/1.0" 200 4394 $
static.apache.log
Code:
127.0.0.1 - - [26/Feb/2009:23:53:15 -0600] "GET /users/drew.PNG HTTP/1.0" 200 6898 "http://www.unravelthemusic.com/home" "Mozilla/5.0 (Windows; U; Windo$