fastcgi_cache_bypass and 502 Bad Gateway

agentzh agentzh at
Mon Feb 14 07:40:17 MSK 2011

On Sat, Feb 12, 2011 at 8:21 AM, António P. P. Almeida <appa at> wrote:
> So there's no concept of scope in the usual programming language
> sense. It just depends on the request. If the request visits all
> locations where variables are set, then the values are set
> independently of the context level at which the assignment
> instructions exist.
> Is this correct?

Correct as long as the "request" in your context is an *atomic*
request, that is, excluding any subrequests that it issues directly or

Even though by default, nginx subrequests also *share* all the
variables of the parent requests (as well as all of its siblings), and
ngx_auth_request, ngx_eval, ngx_addition, and ngx_ssi all follow this
default behavior, some notable exceptions, however, exist in the wild.

Almost all of *our* nginx modules, for example, disable the sharing
because of potential bad effects similar to use of global variables in
a general-purpose programming language. Our ngx_echo, ngx_srcache, and
ngx_lua modules fall into this category, just to name a few :)


More information about the nginx mailing list