mirror of
https://github.com/nginx/nginx.git
synced 2025-07-25 22:56:59 +08:00
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.
This commit is contained in:
parent
3180f84b60
commit
d61f21c5e8
@ -1220,7 +1220,7 @@ ngx_http_add_addresses(ngx_conf_t *cf, ngx_http_core_srv_conf_t *cscf,
|
|||||||
{
|
{
|
||||||
u_char *p;
|
u_char *p;
|
||||||
size_t len, off;
|
size_t len, off;
|
||||||
ngx_uint_t i, default_server;
|
ngx_uint_t i, default_server, proxy_protocol;
|
||||||
struct sockaddr *sa;
|
struct sockaddr *sa;
|
||||||
ngx_http_conf_addr_t *addr;
|
ngx_http_conf_addr_t *addr;
|
||||||
#if (NGX_HAVE_UNIX_DOMAIN)
|
#if (NGX_HAVE_UNIX_DOMAIN)
|
||||||
@ -1281,6 +1281,8 @@ ngx_http_add_addresses(ngx_conf_t *cf, ngx_http_core_srv_conf_t *cscf,
|
|||||||
/* preserve default_server bit during listen options overwriting */
|
/* preserve default_server bit during listen options overwriting */
|
||||||
default_server = addr[i].opt.default_server;
|
default_server = addr[i].opt.default_server;
|
||||||
|
|
||||||
|
proxy_protocol = lsopt->proxy_protocol || addr[i].opt.proxy_protocol;
|
||||||
|
|
||||||
#if (NGX_HTTP_SSL)
|
#if (NGX_HTTP_SSL)
|
||||||
ssl = lsopt->ssl || addr[i].opt.ssl;
|
ssl = lsopt->ssl || addr[i].opt.ssl;
|
||||||
#endif
|
#endif
|
||||||
@ -1314,6 +1316,7 @@ ngx_http_add_addresses(ngx_conf_t *cf, ngx_http_core_srv_conf_t *cscf,
|
|||||||
}
|
}
|
||||||
|
|
||||||
addr[i].opt.default_server = default_server;
|
addr[i].opt.default_server = default_server;
|
||||||
|
addr[i].opt.proxy_protocol = proxy_protocol;
|
||||||
#if (NGX_HTTP_SSL)
|
#if (NGX_HTTP_SSL)
|
||||||
addr[i].opt.ssl = ssl;
|
addr[i].opt.ssl = ssl;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user