Welcome! Log In Create A New Profile

Advanced

why is nginx caching this?

July 13, 2010 12:51PM
I can't make nginx stop caching these files and need help.

This server has nginx as a frontend for django and apache. One of the directories /media/flash/data
must NOT be cached since it is edited by django. I have set headers to turn caching off, and confirmed that this is making the browser not cache, but nginx is still caching it, even though the date of the file is newer than the Expires date and no-cache is set. In fact, I can even restart nginx and it still serves the old file after the restart. I can even delete the file in question from the server and it is still served (the old version). What do I put in this config file to make it read this file every time, or at least anytime it has been updated since the last time it was read from the same browser? Thanks.

server {
listen (ip removed):443;
ssl on;
ssl_certificate /etc/httpd/ssl/bundle-ups-mms-stg.t-3.com.crt;
ssl_certificate_key /etc/httpd/ssl/ups-mms-stg.t-3.com.key;
server_name ups-mms-stg.t-3.com www.ups-mms-stg.t-3.com;
access_log /www/nginx_logs/nginx_access.log;
error_log /www/nginx_logs//nginx_error.log;
location / {
proxy_pass https://(ip removed):4443;
include /etc/nginx/proxy.conf;
}

location /media/ {
root /www/ups-mms/trunk/www/;
}

location /media/flash/data/ {
root /www/ups-mms/branches/stable0.1/www/;
add_header Cache-Control "no-cache";
add_header Last-Modified "";
add_header Expires "Mon, 21 Sep 2009 04:52:34 GMT";
add_header Pragma "no-cache";
}


location /static/ {
root /www/ups-mms/trunk/www/;
}

location /admin_media/ {
root /www/ups-mms/trunk/www/;
}

location /bundles/ {
root /www/ups-mms/trunk/www/;
}

location /videos/ {
root /www/ups-mms/trunk/www/;
}

location /agencies/ {
root /www/ups-mms/trunk/www/;
}
}

server {
listen (ip removed):80;
server_name ups-mms-stg.t-3.com www.ups-mms-stg.t-3.com;
access_log /www/nginx_logs/nginx_access.log;
error_log /www/nginx_logs//nginx_error.log;
location / {
proxy_pass http://(ip removed):8080;
include /etc/nginx/proxy.conf;
}

location /media/ {
root /www/ups-mms/trunk/www/;
}

location /media/flash/data/ {
root /www/ups-mms/branches/stable0.1/www/;
add_header Cache-Control "no-cache";
add_header Last-Modified "";
add_header Expires "Mon, 21 Sep 2009 04:52:34 GMT";
add_header Pragma "no-cache";
}
location /static/ {
root /www/ups-mms/trunk/www/;
}

location /admin_media/ {
root /www/ups-mms/trunk/www/;
}

location /bundles/ {
root /www/ups-mms/trunk/www/;
}

}
Subject Author Posted

why is nginx caching this?

adriannye July 13, 2010 12:51PM

Re: why is nginx caching this?

Piotr Sikora July 13, 2010 01:12PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 59
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready