diff options
author | Maxim Dounin <mdounin@mdounin.ru> | 2014-12-09 18:22:39 +0300 |
---|---|---|
committer | Maxim Dounin <mdounin@mdounin.ru> | 2014-12-09 18:22:39 +0300 |
commit | 827b2511e6ffee946b7b5c00a67bc50449fc2d72 (patch) | |
tree | dbbc97131fb4ef89191476c9bb15f51e4b4475ad /src | |
parent | 8d7c6491fe3dc7cee758a1ec75daf120cd9d82fc (diff) | |
download | nginx-827b2511e6ffee946b7b5c00a67bc50449fc2d72.tar.gz nginx-827b2511e6ffee946b7b5c00a67bc50449fc2d72.zip |
Proxy: fixed incorrect URI change due to if (ticket #86).
In the following configuration request was sent to a backend without
URI changed to '/' due to if:
location /proxy-pass-uri {
proxy_pass http://127.0.0.1:8080/;
set $true 1;
if ($true) {
# nothing
}
}
Fix is to inherit conf->location from the location where proxy_pass was
configured, much like it's done with conf->vars.
Diffstat (limited to 'src')
-rw-r--r-- | src/http/modules/ngx_http_proxy_module.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/http/modules/ngx_http_proxy_module.c b/src/http/modules/ngx_http_proxy_module.c index 5b5ad07b9..f04436de4 100644 --- a/src/http/modules/ngx_http_proxy_module.c +++ b/src/http/modules/ngx_http_proxy_module.c @@ -2997,6 +2997,7 @@ ngx_http_proxy_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child) && conf->upstream.upstream == NULL && conf->proxy_lengths == NULL) { conf->upstream.upstream = prev->upstream.upstream; + conf->location = prev->location; conf->vars = prev->vars; conf->proxy_lengths = prev->proxy_lengths; @@ -3011,7 +3012,6 @@ ngx_http_proxy_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child) && (conf->upstream.upstream || conf->proxy_lengths)) { clcf->handler = ngx_http_proxy_handler; - conf->location = prev->location; } if (conf->body_source.data == NULL) { |