]> git.kaiwu.me - nginx.git/commit
Upstream: fixed unexpected inheritance into limit_except blocks.
authorMaxim Dounin <mdounin@mdounin.ru>
Tue, 9 Dec 2014 15:22:31 +0000 (18:22 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Tue, 9 Dec 2014 15:22:31 +0000 (18:22 +0300)
commit8d7c6491fe3dc7cee758a1ec75daf120cd9d82fc
tree16779f1fba4fd25ec0e028630d09f1f107e75979
parentc863e1b3b56e647b9cc9c9aeed53a9ab309194ed
Upstream: fixed unexpected inheritance into limit_except blocks.

The proxy_pass directive and other handlers are not expected to be inherited
into nested locations, but there is a special code to inherit upstream
handlers into limit_except blocks, as well as a configuration into if{}
blocks.  This caused incorrect behaviour in configurations with nested
locations and limit_except blocks, like this:

    location / {
        proxy_pass http://u;

        location /inner/ {
            # no proxy_pass here

            limit_except GET {
                # nothing
            }
        }
    }

In such a configuration the limit_except block inside "location /inner/"
unexpectedly used proxy_pass defined in "location /", while it shouldn't.
Fix is to avoid inheritance of conf->upstream.upstream (and
conf->proxy_lengths) into locations which don't have noname flag.
src/http/modules/ngx_http_fastcgi_module.c
src/http/modules/ngx_http_proxy_module.c
src/http/modules/ngx_http_scgi_module.c
src/http/modules/ngx_http_uwsgi_module.c