Welcome! Log In Create A New Profile

Advanced

Re: Bug while using "proxy_cache_use_stale updating"

December 15, 2009 11:09PM
I was wondering if anyone else is still having this problem of Nginx getting stuck in the UPDATING state after upgrading to the fixed version of Nginx.

I saw this using Nginx 0.7.62 and I upgraded to 0.8.24 because I saw it had been fixed, but recently saw the problem again.

Here is my configuration:
[code]
proxy_cache_path /mnt/nginx_cache levels=1:2
keys_zone=one:10m
inactive=7d max_size=10g;
proxy_cache_path /mnt/nginx_cache_media levels=1:2
keys_zone=MEDIA:10m
inactive=7d max_size=5g;
proxy_temp_path /var/www/nginx_temp;

server {
listen 80;
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_pass_header Set-Cookie;
client_max_body_size 8m;

# capture cookies for use in the cache key
set $wordpress_logged_in "";
set $comment_author_email "";
set $comment_author "";
if ($http_cookie ~* "wordpress_logged_in_[^=]*=([^%]+)%7C") {
set $wordpress_logged_in wordpress_logged_in_$1;
}
if ($http_cookie ~* "comment_author_email_[^=]*=([^;]+)(;|$)") {
set $comment_author_email comment_author_email_$1;
}
if ($http_cookie ~* "comment_author_[^=]*=([^;]+)(;|$)") {
set $comment_author comment_author_$1;
}
set $my_cache_key $scheme$host$uri$is_args$args$wordpress_logged_in$comment_author_email$comment_author;

# proxy cache config for media files
location ~* \.(gif|jpg|jpeg|png|js|css)$ {
proxy_pass http://backend;
proxy_cache MEDIA;
proxy_cache_key $my_cache_key;

proxy_cache_valid 200 302 304 30d;
proxy_cache_valid 301 1h;
proxy_cache_valid any 1m;
proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504 http_404;
expires 30d;
}

# proxy cache config for all other files
location / {
proxy_pass http://backend;
proxy_cache one;
proxy_cache_key $my_cache_key;

proxy_cache_valid 200 302 304 10m;
proxy_cache_valid 301 1h;
proxy_cache_valid any 1m;
proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504 http_404;
}

# Don't use the cache for the following locations
location /wp-admin {
proxy_read_timeout 180;
proxy_pass http://backend;
}
location /wp-login.php { proxy_pass http://backend; }
}
[/code]
Subject Author Posted

Bug while using "proxy_cache_use_stale updating"

J August 27, 2009 05:06AM

Re: Bug while using "proxy_cache_use_stale updating"

icqheretic August 27, 2009 12:58PM

Re: Bug while using "proxy_cache_use_stale updating"

J August 27, 2009 06:29PM

Re: Bug while using "proxy_cache_use_stale updating"

J August 28, 2009 07:59AM

Re: Bug while using "proxy_cache_use_stale updating"

J August 28, 2009 09:57AM

Re: Bug while using "proxy_cache_use_stale updating"

Igor Sysoev August 28, 2009 12:43PM

Re: Bug while using "proxy_cache_use_stale updating"

Igor Sysoev September 02, 2009 05:49PM

Re: Bug while using "proxy_cache_use_stale updating"

Jérôme Loyet September 02, 2009 05:49PM

Re: Bug while using "proxy_cache_use_stale updating"

saltyflorida December 15, 2009 11:09PM

Re: Bug while using "proxy_cache_use_stale updating"

archon810 November 14, 2011 10:36PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 137
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready