library/roles/smartgears/smartgears-nginx-frontend/templates/generic-smartgears-virtualhost.j2: Manage the real_ip scenario when we are behind haproxy.

This commit is contained in:
Andrea Dell'Amico 2016-10-03 18:35:07 +02:00
parent 61a0f90bb4
commit f4d3393235
1 changed files with 8 additions and 0 deletions

View File

@ -86,6 +86,14 @@ server {
client_max_body_size 100M;
{% if haproxy_ips is defined %}
# We are behind haproxy
{% for ip in haproxy_ips %}
set_real_ip_from {{ ip }};
{% endfor %}
real_ip_header X-Forwarded-For;
{% endif %}
include /etc/nginx/snippets/nginx-server-ssl.conf;
# redirect server error pages to the static page /50x.html