comparison src/http/modules/ngx_http_proxy_module.c @ 5939:aeea0522332f

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.
author Maxim Dounin <mdounin@mdounin.ru>
date Tue, 09 Dec 2014 18:22:39 +0300
parents cd2abf7e7740
children e3b3b89d74e8
comparison
equal deleted inserted replaced
5938:cd2abf7e7740 5939:aeea0522332f
2995 2995
2996 if (clcf->noname 2996 if (clcf->noname
2997 && conf->upstream.upstream == NULL && conf->proxy_lengths == NULL) 2997 && conf->upstream.upstream == NULL && conf->proxy_lengths == NULL)
2998 { 2998 {
2999 conf->upstream.upstream = prev->upstream.upstream; 2999 conf->upstream.upstream = prev->upstream.upstream;
3000 conf->location = prev->location;
3000 conf->vars = prev->vars; 3001 conf->vars = prev->vars;
3001 3002
3002 conf->proxy_lengths = prev->proxy_lengths; 3003 conf->proxy_lengths = prev->proxy_lengths;
3003 conf->proxy_values = prev->proxy_values; 3004 conf->proxy_values = prev->proxy_values;
3004 3005
3009 3010
3010 if (clcf->lmt_excpt && clcf->handler == NULL 3011 if (clcf->lmt_excpt && clcf->handler == NULL
3011 && (conf->upstream.upstream || conf->proxy_lengths)) 3012 && (conf->upstream.upstream || conf->proxy_lengths))
3012 { 3013 {
3013 clcf->handler = ngx_http_proxy_handler; 3014 clcf->handler = ngx_http_proxy_handler;
3014 conf->location = prev->location;
3015 } 3015 }
3016 3016
3017 if (conf->body_source.data == NULL) { 3017 if (conf->body_source.data == NULL) {
3018 conf->body_flushes = prev->body_flushes; 3018 conf->body_flushes = prev->body_flushes;
3019 conf->body_source = prev->body_source; 3019 conf->body_source = prev->body_source;