summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/http/modules/ngx_http_proxy_module.c1
-rw-r--r--src/http/ngx_http_upstream.c6
2 files changed, 7 insertions, 0 deletions
diff --git a/src/http/modules/ngx_http_proxy_module.c b/src/http/modules/ngx_http_proxy_module.c
index c8dca82ae..52f67b305 100644
--- a/src/http/modules/ngx_http_proxy_module.c
+++ b/src/http/modules/ngx_http_proxy_module.c
@@ -2237,6 +2237,7 @@ ngx_http_proxy_pass(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
if (port == 80) {
plcf->port.len = sizeof("80") - 1;
plcf->port.data = (u_char *) "80";
+
} else {
plcf->port.len = sizeof("443") - 1;
plcf->port.data = (u_char *) "443";
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
index 376b85fcd..bc4567458 100644
--- 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, ngx_url_t *u, ngx_uint_t flags)
continue;
}
+ if (uscfp[i]->default_port && u->default_port
+ && uscfp[i]->default_port != u->default_port)
+ {
+ continue;
+ }
+
return uscfp[i];
}