Welcome! Log In Create A New Profile

Advanced

[nginx] Upstream: consistently initialize explicit upstreams.

October 31, 2016 04:42PM
details: http://hg.nginx.org/nginx/rev/640e1e778de6
branches:
changeset: 6787:640e1e778de6
user: Ruslan Ermilov <ru@nginx.com>
date: Mon Oct 17 14:14:02 2016 +0300
description:
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; }

diffstat:

src/http/ngx_http_upstream.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diffs (12 lines):

diff -r 906ac20234ed -r 640e1e778de6 src/http/ngx_http_upstream.c
--- a/src/http/ngx_http_upstream.c Mon Oct 31 18:33:36 2016 +0300
+++ b/src/http/ngx_http_upstream.c Mon Oct 17 14:14:02 2016 +0300
@@ -5768,6 +5768,8 @@ ngx_http_upstream_add(ngx_conf_t *cf, ng

if (flags & NGX_HTTP_UPSTREAM_CREATE) {
uscfp[i]->flags = flags;
+ uscfp[i]->port = 0;
+ uscfp[i]->default_port = 0;
}

return uscfp[i];

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Upstream: consistently initialize explicit upstreams.

ru@nginx.com 535 October 31, 2016 04:42PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 302
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready