[nginx] Merge proxy_protocol setting of listen directives.

Roman Arutyunyan arut at nginx.com
Fri Apr 24 07:55:16 UTC 2015


details:   http://hg.nginx.org/nginx/rev/69ad3e77922b
branches:  
changeset: 6128:69ad3e77922b
user:      Roman Arutyunyan <arut at nginx.com>
date:      Fri Apr 24 10:54:06 2015 +0300
description:
Merge proxy_protocol setting of listen directives.

It's now enough to specify proxy_protocol option in one listen directive to
enable it in all servers listening on the same address/port.  Previously,
the setting from the first directive was always used.

diffstat:

 src/http/ngx_http.c |  5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diffs (29 lines):

diff -r 967594ba7571 -r 69ad3e77922b src/http/ngx_http.c
--- a/src/http/ngx_http.c	Thu Apr 23 14:26:11 2015 +0300
+++ b/src/http/ngx_http.c	Fri Apr 24 10:54:06 2015 +0300
@@ -1220,7 +1220,7 @@ ngx_http_add_addresses(ngx_conf_t *cf, n
 {
     u_char                *p;
     size_t                 len, off;
-    ngx_uint_t             i, default_server;
+    ngx_uint_t             i, default_server, proxy_protocol;
     struct sockaddr       *sa;
     ngx_http_conf_addr_t  *addr;
 #if (NGX_HAVE_UNIX_DOMAIN)
@@ -1281,6 +1281,8 @@ ngx_http_add_addresses(ngx_conf_t *cf, n
         /* preserve default_server bit during listen options overwriting */
         default_server = addr[i].opt.default_server;
 
+        proxy_protocol = lsopt->proxy_protocol || addr[i].opt.proxy_protocol;
+
 #if (NGX_HTTP_SSL)
         ssl = lsopt->ssl || addr[i].opt.ssl;
 #endif
@@ -1314,6 +1316,7 @@ ngx_http_add_addresses(ngx_conf_t *cf, n
         }
 
         addr[i].opt.default_server = default_server;
+        addr[i].opt.proxy_protocol = proxy_protocol;
 #if (NGX_HTTP_SSL)
         addr[i].opt.ssl = ssl;
 #endif



More information about the nginx-devel mailing list