From d754c97abc103f6cb3c4d9385daa8547245a07e6 Mon Sep 17 00:00:00 2001
From: Christos Trochalakis <yatiohi@ideopolis.gr>
Date: Wed, 16 Nov 2016 10:52:08 +0200
Subject: [PATCH] Don't use default_port (dropped in nginx 1.11.6)

See:
4dea01cf49e8 Upstream: removed ngx_http_upstream_srv_conf_t.default_port.
3fa5983b6b44 Upstream: don't consider default_port when matching upstreams.
---
 ngx_http_upstream_fair_module.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ngx_http_upstream_fair_module.c b/ngx_http_upstream_fair_module.c
index a4419ca..5d76bb4 100644
--- a/ngx_http_upstream_fair_module.c
+++ b/ngx_http_upstream_fair_module.c
@@ -540,7 +540,7 @@ ngx_http_upstream_init_fair_rr(ngx_conf_t *cf, ngx_http_upstream_srv_conf_t *us)
 
     /* an upstream implicitly defined by proxy_pass, etc. */
 
-    if (us->port == 0 && us->default_port == 0) {
+    if (us->port == 0) {
         ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
                       "no port in upstream \"%V\" in %s:%ui",
                       &us->host, us->file_name, us->line);
@@ -550,7 +550,7 @@ ngx_http_upstream_init_fair_rr(ngx_conf_t *cf, ngx_http_upstream_srv_conf_t *us)
     ngx_memzero(&u, sizeof(ngx_url_t));
 
     u.host = us->host;
-    u.port = (in_port_t) (us->port ? us->port : us->default_port);
+    u.port = (in_port_t) us->port;
 
     if (ngx_inet_resolve_host(cf->pool, &u) != NGX_OK) {
         if (u.err) {
-- 
2.10.2

