diff src/http/modules/ngx_http_proxy_module.c @ 6303:a93345ee8f52

Upstream: fixed "no port" detection in evaluated upstreams. If an upstream with variables evaluated to address without a port, then instead of a "no port in upstream" error an attempt was made to connect() which failed with EADDRNOTAVAIL.
author Ruslan Ermilov <ru@nginx.com>
date Sat, 21 Nov 2015 10:44:07 +0300
parents 4d5ac1a31d44
children 44122bddd9a1
line wrap: on
line diff
--- a/src/http/modules/ngx_http_proxy_module.c
+++ b/src/http/modules/ngx_http_proxy_module.c
@@ -1015,10 +1015,11 @@ ngx_http_proxy_eval(ngx_http_request_t *
 
     } else {
         u->resolved->host = url.host;
-        u->resolved->port = (in_port_t) (url.no_port ? port : url.port);
-        u->resolved->no_port = url.no_port;
     }
 
+    u->resolved->port = (in_port_t) (url.no_port ? port : url.port);
+    u->resolved->no_port = url.no_port;
+
     return NGX_OK;
 }