Welcome! Log In Create A New Profile

Advanced

fastcgi_cache_bypass and 502 Bad Gateway

February 10, 2011 07:08AM
Using Nginx 0.8.54.

I'm trying to use fastcgi_cache_bypass with an HTTP header for Nginx to request a new response from the backend and cache it.

[code]
if ($http_cookie ~* "comment_author_|wordpress_(?!test_cookie)|wp-postpass_" ) {
set $donot_cache 1;
}

fastcgi_cache cachetitle;
fastcgi_cache_key $scheme$host$request_uri;
fastcgi_no_cache $donot_cache; # do no cache at all
fastcgi_cache_bypass $http_cache_bypass; # bypass cache and cache the new response
fastcgi_cache_use_stale error timeout invalid_header http_500;
fastcgi_cache_min_uses 1;
[/code]

It does seem to work -- I see a fresh page returned from the backend, but on the second request without the header I get a 502 Bad Gateway response.

I also noticed that on Nginx wiki page there is no reference to fastcgi_cache_bypass, although I saw it there just a few days ago.

Is this feature being removed or postponed for later? Is it available in the latest dev version?

Kaspars
http://konstruktors.com
Subject Author Posted

fastcgi_cache_bypass and 502 Bad Gateway

kaspars February 10, 2011 07:08AM

Re: fastcgi_cache_bypass and 502 Bad Gateway

kaspars February 11, 2011 08:24AM

Re: fastcgi_cache_bypass and 502 Bad Gateway

Dayo February 11, 2011 10:15AM

Re: fastcgi_cache_bypass and 502 Bad Gateway

kaspars February 11, 2011 11:31AM

Re: fastcgi_cache_bypass and 502 Bad Gateway

Dayo February 11, 2011 11:57AM

Re: fastcgi_cache_bypass and 502 Bad Gateway

kaspars February 11, 2011 12:07PM

Re: fastcgi_cache_bypass and 502 Bad Gateway

Dayo February 11, 2011 12:50PM

Re: fastcgi_cache_bypass and 502 Bad Gateway

Maxim Dounin February 11, 2011 01:08PM

Re: fastcgi_cache_bypass and 502 Bad Gateway

kaspars February 11, 2011 04:19PM

Re: fastcgi_cache_bypass and 502 Bad Gateway

António P. P. Almeida February 11, 2011 04:58PM

Re: fastcgi_cache_bypass and 502 Bad Gateway

Maxim Dounin February 11, 2011 07:10PM

Re: fastcgi_cache_bypass and 502 Bad Gateway

António P. P. Almeida February 11, 2011 07:30PM

Re: fastcgi_cache_bypass and 502 Bad Gateway

Dayo February 12, 2011 04:15AM

Re: fastcgi_cache_bypass and 502 Bad Gateway

kaspars February 13, 2011 09:18AM

Re: fastcgi_cache_bypass and 502 Bad Gateway

António P. P. Almeida February 12, 2011 07:52AM

Re: fastcgi_cache_bypass and 502 Bad Gateway

agentzh February 13, 2011 11:42PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 70
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