|
@@ -55,7 +55,7 @@ set_real_ip_from fc00::/7;
|
|
{% for TRUSTED_PROXY in TRUSTED_PROXIES %}
|
|
{% for TRUSTED_PROXY in TRUSTED_PROXIES %}
|
|
set_real_ip_from {{ TRUSTED_PROXY }};
|
|
set_real_ip_from {{ TRUSTED_PROXY }};
|
|
{% endfor %}
|
|
{% endfor %}
|
|
-{% if not NGINX_USE_PROXY_PROTOCOL %}
|
|
|
|
|
|
+{% if not NGINX_USE_PROXY_PROTOCOL|lower in ["y", "yes"] %}
|
|
real_ip_header X-Forwarded-For;
|
|
real_ip_header X-Forwarded-For;
|
|
{% else %}
|
|
{% else %}
|
|
real_ip_header proxy_protocol;
|
|
real_ip_header proxy_protocol;
|
|
@@ -137,28 +137,28 @@ location ~ /(?:m|M)ail/(?:c|C)onfig-v1.1.xml {
|
|
try_files /autoconfig.php =404;
|
|
try_files /autoconfig.php =404;
|
|
}
|
|
}
|
|
|
|
|
|
-{% if not SKIP_RSPAMD %}
|
|
|
|
|
|
+{% if not SKIP_RSPAMD|lower in ["y", "yes"] %}
|
|
location /rspamd/ {
|
|
location /rspamd/ {
|
|
location /rspamd/auth {
|
|
location /rspamd/auth {
|
|
# proxy_pass is not inherited
|
|
# proxy_pass is not inherited
|
|
proxy_pass http://{{ RSPAMDHOST }}:11334/auth;
|
|
proxy_pass http://{{ RSPAMDHOST }}:11334/auth;
|
|
proxy_intercept_errors on;
|
|
proxy_intercept_errors on;
|
|
proxy_set_header Host $http_host;
|
|
proxy_set_header Host $http_host;
|
|
- proxy_set_header X-Forwarded-For {% if not NGINX_USE_PROXY_PROTOCOL %}$proxy_add_x_forwarded_for{% else %}$proxy_protocol_addr{%endif%};
|
|
|
|
- proxy_set_header X-Real-IP {% if not NGINX_USE_PROXY_PROTOCOL %}$remote_addr{% else %}$proxy_protocol_addr{%endif%};
|
|
|
|
|
|
+ proxy_set_header X-Forwarded-For {% if not NGINX_USE_PROXY_PROTOCOL|lower in ["y", "yes"] %}$proxy_add_x_forwarded_for{% else %}$proxy_protocol_addr{%endif%};
|
|
|
|
+ proxy_set_header X-Real-IP {% if not NGINX_USE_PROXY_PROTOCOL|lower in ["y", "yes"] %}$remote_addr{% else %}$proxy_protocol_addr{%endif%};
|
|
proxy_redirect off;
|
|
proxy_redirect off;
|
|
error_page 401 /_rspamderror.php;
|
|
error_page 401 /_rspamderror.php;
|
|
}
|
|
}
|
|
|
|
|
|
proxy_pass http://{{ RSPAMDHOST }}:11334/;
|
|
proxy_pass http://{{ RSPAMDHOST }}:11334/;
|
|
proxy_set_header Host $http_host;
|
|
proxy_set_header Host $http_host;
|
|
- proxy_set_header X-Forwarded-For {% if not NGINX_USE_PROXY_PROTOCOL %}$proxy_add_x_forwarded_for{% else %}$proxy_protocol_addr{%endif%};
|
|
|
|
- proxy_set_header X-Real-IP {% if not NGINX_USE_PROXY_PROTOCOL %}$remote_addr{% else %}$proxy_protocol_addr{%endif%};
|
|
|
|
|
|
+ proxy_set_header X-Forwarded-For {% if not NGINX_USE_PROXY_PROTOCOL|lower in ["y", "yes"] %}$proxy_add_x_forwarded_for{% else %}$proxy_protocol_addr{%endif%};
|
|
|
|
+ proxy_set_header X-Real-IP {% if not NGINX_USE_PROXY_PROTOCOL|lower in ["y", "yes"] %}$remote_addr{% else %}$proxy_protocol_addr{%endif%};
|
|
proxy_redirect off;
|
|
proxy_redirect off;
|
|
}
|
|
}
|
|
{% endif %}
|
|
{% endif %}
|
|
|
|
|
|
-{% if not SKIP_SOGO %}
|
|
|
|
|
|
+{% if not SKIP_SOGO|lower in ["y", "yes"] %}
|
|
location ^~ /principals {
|
|
location ^~ /principals {
|
|
return 301 /SOGo/dav;
|
|
return 301 /SOGo/dav;
|
|
}
|
|
}
|
|
@@ -184,8 +184,8 @@ location ^~ /Microsoft-Server-ActiveSync {
|
|
|
|
|
|
proxy_pass http://{{ SOGOHOST }}:20000/SOGo/Microsoft-Server-ActiveSync;
|
|
proxy_pass http://{{ SOGOHOST }}:20000/SOGo/Microsoft-Server-ActiveSync;
|
|
|
|
|
|
- proxy_set_header X-Forwarded-For {% if not NGINX_USE_PROXY_PROTOCOL %}$proxy_add_x_forwarded_for{% else %}$proxy_protocol_addr{%endif%};
|
|
|
|
- proxy_set_header X-Real-IP {% if not NGINX_USE_PROXY_PROTOCOL %}$remote_addr{% else %}$proxy_protocol_addr{%endif%};
|
|
|
|
|
|
+ proxy_set_header X-Forwarded-For {% if not NGINX_USE_PROXY_PROTOCOL|lower in ["y", "yes"] %}$proxy_add_x_forwarded_for{% else %}$proxy_protocol_addr{%endif%};
|
|
|
|
+ proxy_set_header X-Real-IP {% if not NGINX_USE_PROXY_PROTOCOL|lower in ["y", "yes"] %}$remote_addr{% else %}$proxy_protocol_addr{%endif%};
|
|
proxy_connect_timeout 75;
|
|
proxy_connect_timeout 75;
|
|
proxy_send_timeout 3600;
|
|
proxy_send_timeout 3600;
|
|
proxy_read_timeout 3600;
|
|
proxy_read_timeout 3600;
|
|
@@ -209,8 +209,8 @@ location ^~ /SOGo {
|
|
|
|
|
|
proxy_pass http://{{ SOGOHOST }}:20000;
|
|
proxy_pass http://{{ SOGOHOST }}:20000;
|
|
|
|
|
|
- proxy_set_header X-Forwarded-For {% if not NGINX_USE_PROXY_PROTOCOL %}$proxy_add_x_forwarded_for{% else %}$proxy_protocol_addr{%endif%};
|
|
|
|
- proxy_set_header X-Real-IP {% if not NGINX_USE_PROXY_PROTOCOL %}$remote_addr{% else %}$proxy_protocol_addr{%endif%};
|
|
|
|
|
|
+ proxy_set_header X-Forwarded-For {% if not NGINX_USE_PROXY_PROTOCOL|lower in ["y", "yes"] %}$proxy_add_x_forwarded_for{% else %}$proxy_protocol_addr{%endif%};
|
|
|
|
+ proxy_set_header X-Real-IP {% if not NGINX_USE_PROXY_PROTOCOL|lower in ["y", "yes"] %}$remote_addr{% else %}$proxy_protocol_addr{%endif%};
|
|
proxy_set_header Host $http_host;
|
|
proxy_set_header Host $http_host;
|
|
proxy_set_header x-webobjects-server-protocol HTTP/1.0;
|
|
proxy_set_header x-webobjects-server-protocol HTTP/1.0;
|
|
proxy_set_header x-webobjects-remote-host $remote_addr;
|
|
proxy_set_header x-webobjects-remote-host $remote_addr;
|
|
@@ -231,8 +231,8 @@ location ^~ /SOGo {
|
|
|
|
|
|
proxy_pass http://{{ SOGOHOST }}:20000;
|
|
proxy_pass http://{{ SOGOHOST }}:20000;
|
|
|
|
|
|
- proxy_set_header X-Forwarded-For {% if not NGINX_USE_PROXY_PROTOCOL %}$proxy_add_x_forwarded_for{% else %}$proxy_protocol_addr{%endif%};
|
|
|
|
- proxy_set_header X-Real-IP {% if not NGINX_USE_PROXY_PROTOCOL %}$remote_addr{% else %}$proxy_protocol_addr{%endif%};
|
|
|
|
|
|
+ proxy_set_header X-Forwarded-For {% if not NGINX_USE_PROXY_PROTOCOL|lower in ["y", "yes"] %}$proxy_add_x_forwarded_for{% else %}$proxy_protocol_addr{%endif%};
|
|
|
|
+ proxy_set_header X-Real-IP {% if not NGINX_USE_PROXY_PROTOCOL|lower in ["y", "yes"] %}$remote_addr{% else %}$proxy_protocol_addr{%endif%};
|
|
proxy_set_header Host $http_host;
|
|
proxy_set_header Host $http_host;
|
|
proxy_set_header x-webobjects-server-protocol HTTP/1.0;
|
|
proxy_set_header x-webobjects-server-protocol HTTP/1.0;
|
|
proxy_set_header x-webobjects-remote-host $remote_addr;
|
|
proxy_set_header x-webobjects-remote-host $remote_addr;
|