Changeset 6787:640e1e778de6 in nginx


Ignore:
Timestamp:
10/17/16 11:14:02 (3 years ago)
Author:
Ruslan Ermilov <ru@…>
Branch:
default
Phase:
public
Message:

Upstream: consistently initialize explicit upstreams.

When an upstream{} block follows a proxy_pass reference to it,
such an upstream inherited port and default_port settings from
proxy_pass. This was different from when they came in another
order (see ticket #1059). Explicit upstreams should not have
port and default_port in any case.

This fixes the following case:

server { location / { proxy_pass http://u; } ... }
upstream u { server 127.0.0.1; }
server { location / { proxy_pass https://u; } ... }

but not the following:

server { location / { proxy_pass http://u; } ... }
server { location / { proxy_pass https://u; } ... }
upstream u { server 127.0.0.1; }

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/http/ngx_http_upstream.c

    r6786 r6787  
    57695769        if (flags & NGX_HTTP_UPSTREAM_CREATE) {
    57705770            uscfp[i]->flags = flags;
     5771            uscfp[i]->port = 0;
     5772            uscfp[i]->default_port = 0;
    57715773        }
    57725774
Note: See TracChangeset for help on using the changeset viewer.