mirror of
https://github.com/nginx/nginx.git
synced 2025-07-30 01:46:14 +08:00
r1340, r1341 merge:
fix case when two directives proxy_pass http://backend; proxy_pass https://backend; both use one port - 80 or 443, that was defined first.
This commit is contained in:
parent
e8c487cde3
commit
0688e927d6
@ -2237,6 +2237,7 @@ ngx_http_proxy_pass(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
|||||||
if (port == 80) {
|
if (port == 80) {
|
||||||
plcf->port.len = sizeof("80") - 1;
|
plcf->port.len = sizeof("80") - 1;
|
||||||
plcf->port.data = (u_char *) "80";
|
plcf->port.data = (u_char *) "80";
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
plcf->port.len = sizeof("443") - 1;
|
plcf->port.len = sizeof("443") - 1;
|
||||||
plcf->port.data = (u_char *) "443";
|
plcf->port.data = (u_char *) "443";
|
||||||
|
@ -3209,6 +3209,12 @@ ngx_http_upstream_add(ngx_conf_t *cf, ngx_url_t *u, ngx_uint_t flags)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (uscfp[i]->default_port && u->default_port
|
||||||
|
&& uscfp[i]->default_port != u->default_port)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
return uscfp[i];
|
return uscfp[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user