Nginx as reverse proxy to Hudson-Logout issue.

Igor Sysoev igor at sysoev.ru
Tue Sep 7 12:21:37 MSD 2010


On Tue, Sep 07, 2010 at 03:54:55AM -0400, mogaroy wrote:

> Fixed it for IE as well with this:
> 
> [b]add_header Cache-Control "no-cache";[/b]

Yes, this is right way.

However, this configuration is wrong:

location / {
    root /var/www;
    include cache-control.conf;
    index index.html index.htm;
}

cache-control.conf:

# default cache 1 day
expires +1d;

if ($request_uri ~* "^/services/.*$") {
expires +0d;
add_header Pragma "no-cache";
}

if ($request_uri ~* "^/(index.html)?$") {
expires +1h;
}

It may work in some case and may not work in others.
It should be rewritten as:

root /var/www;
index index.html index.htm;

location = / {
    expires +1h;
}

location = /index.html {
    expires +1h;
}

location / {
    index index.html index.htm;
    expires +1d;
}

location /services/ {
    index index.html index.htm;
    expires -1;
}


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



More information about the nginx mailing list