| 1 | # HG changeset patch
|
|---|
| 2 | # User Ruslan Ermilov <ru@nginx.com>
|
|---|
| 3 | # Date 1449660845 -10800
|
|---|
| 4 | # Wed Dec 09 14:34:05 2015 +0300
|
|---|
| 5 | # Node ID 4c42fecba50b9d34a57a330d76e89780ff3fe510
|
|---|
| 6 | # Parent df31fbbd6f7f3bebc61df8d829a06d7d97921eb7
|
|---|
| 7 | Fixed proxy_pass and friends with UNIX sockets and variables.
|
|---|
| 8 |
|
|---|
| 9 | This was broken in a93345ee8f52 (1.9.8).
|
|---|
| 10 |
|
|---|
| 11 | diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
|
|---|
| 12 | --- a/src/http/ngx_http_upstream.c
|
|---|
| 13 | +++ b/src/http/ngx_http_upstream.c
|
|---|
| 14 | @@ -642,7 +642,9 @@ ngx_http_upstream_init_request(ngx_http_
|
|---|
| 15 |
|
|---|
| 16 | if (u->resolved->sockaddr) {
|
|---|
| 17 |
|
|---|
| 18 | - if (u->resolved->port == 0) {
|
|---|
| 19 | + if (u->resolved->sockaddr->sa_family != AF_UNIX
|
|---|
| 20 | + && u->resolved->port == 0)
|
|---|
| 21 | + {
|
|---|
| 22 | ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
|
|---|
| 23 | "no port in upstream \"%V\"", host);
|
|---|
| 24 | ngx_http_upstream_finalize_request(r, u,
|
|---|