diff --git a/webmails/nginx-webmail.conf b/webmails/nginx-webmail.conf index 1794a635..1bc00912 100644 --- a/webmails/nginx-webmail.conf +++ b/webmails/nginx-webmail.conf @@ -26,6 +26,14 @@ server { add_header X-Permitted-Cross-Domain-Policies "none" always; add_header Referrer-Policy "no-referrer" always; + real_ip_header X-Real-IP; + {% for from_ip in SUBNET.split(',') %} + set_real_ip_from {{ from_ip }}; + {% endfor %} + {% if SUBNET6 %}{% for from_ip in SUBNET6.split(',') %} + set_real_ip_from {{ from_ip }}; + {% endfor %}{% endif %} + location / { try_files $uri $uri/ /index.php$args; }