fastcgi_cache_key with cookie

António P. P. Almeida appa at
Tue Dec 27 09:05:18 UTC 2011

On 27 Dez 2011 08h24 WET, nginx-forum at wrote:

> Sorry I dont quite understand whats going on in your config.
> error_page 418 @auth-cache;
> if ($logged_in) {
> return 418;
> what does this do?  looked up http error 418 "I'm a teapot" ROFL.
> so going line by line

Yes, hence it's innocuous to use :) You get to keep all other for real
status codes.

The map sets the value of the $logged_in variable. If there's a cookie
with SESS it sets it to 1. The default is 0.

If $logged_in is 1 then return a 418. The error_page directive sets
the 418 error page to be the @auth-cache location. 

--- appa

> Posted at Nginx Forum:
> _______________________________________________
> nginx mailing list
> nginx at

More information about the nginx mailing list