# HG changeset patch
# User Ruslan Ermilov <ru@nginx.com>
# Date 1449660845 -10800
#      Wed Dec 09 14:34:05 2015 +0300
# Node ID 4c42fecba50b9d34a57a330d76e89780ff3fe510
# Parent  df31fbbd6f7f3bebc61df8d829a06d7d97921eb7
Fixed proxy_pass and friends with UNIX sockets and variables.

This was broken in a93345ee8f52 (1.9.8).

diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -642,7 +642,9 @@ ngx_http_upstream_init_request(ngx_http_
 
         if (u->resolved->sockaddr) {
 
-            if (u->resolved->port == 0) {
+            if (u->resolved->sockaddr->sa_family != AF_UNIX
+                && u->resolved->port == 0)
+            {
                 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
                               "no port in upstream \"%V\"", host);
                 ngx_http_upstream_finalize_request(r, u,
