# HG changeset patch # User Igor Sysoev # Date 1185194121 0 # Node ID 32cdba6f2ec17111b7d63662c49d4335be51cab6 # Parent 50b6cd5bc2e2a52b932067778ca17fff0af9ffd0 fix case when two directives proxy_pass http://backend; proxy_pass https://backend; both use one port - 80 or 443, that was defined first. diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c --- a/src/http/ngx_http_upstream.c +++ b/src/http/ngx_http_upstream.c @@ -3209,6 +3209,12 @@ ngx_http_upstream_add(ngx_conf_t *cf, ng continue; } + if (uscfp[i]->default_port && u->default_port + && uscfp[i]->default_port != u->default_port) + { + continue; + } + return uscfp[i]; }