library/roles/nginx/templates/nginx-proxy-params.conf.j2: Some proxy statements must be conditional to the presence of an haproxy load balancer.
This commit is contained in:
parent
68191f9571
commit
731c27cc5b
|
@ -1,10 +1,14 @@
|
||||||
# Proxy stuff
|
# Proxy stuff
|
||||||
# include /etc/nginx/snippets/nginx-proxy-params.conf;
|
# include /etc/nginx/snippets/nginx-proxy-params.conf;
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
|
{% if haproxy_ips is defined %}
|
||||||
proxy_set_header Host $http_host;
|
proxy_set_header Host $http_host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-Host $remote_addr;
|
proxy_set_header X-Forwarded-Host $remote_addr;
|
||||||
proxy_set_header X-Forwarded-Server $host;
|
proxy_set_header X-Forwarded-Server $host;
|
||||||
|
{% else %}
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
{% endif %}
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
proxy_buffering {{ nginx_proxy_buffering }};
|
proxy_buffering {{ nginx_proxy_buffering }};
|
||||||
|
|
Loading…
Reference in New Issue