diff --git a/puppet/zulip/files/nginx/zulip-include/app b/puppet/zulip/files/nginx/zulip-include/app index 9a780d3c02..18f500bf1b 100644 --- a/puppet/zulip/files/nginx/zulip-include/app +++ b/puppet/zulip/files/nginx/zulip-include/app @@ -19,7 +19,6 @@ location ~ /json/get_events|/json/events|/api/v1/events { include /etc/nginx/zulip-include/proxy_longpolling; proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } # Send sockjs requests to Tornado diff --git a/puppet/zulip/files/nginx/zulip-include/location-sockjs b/puppet/zulip/files/nginx/zulip-include/location-sockjs index 13101b0dfd..74b6fb5bdf 100644 --- a/puppet/zulip/files/nginx/zulip-include/location-sockjs +++ b/puppet/zulip/files/nginx/zulip-include/location-sockjs @@ -4,4 +4,3 @@ include /etc/nginx/zulip-include/proxy_longpolling; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; proxy_set_header X-Real-IP $remote_addr; -proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; diff --git a/puppet/zulip/files/nginx/zulip-include/proxy b/puppet/zulip/files/nginx/zulip-include/proxy index 4a81122476..c25364042b 100644 --- a/puppet/zulip/files/nginx/zulip-include/proxy +++ b/puppet/zulip/files/nginx/zulip-include/proxy @@ -1,4 +1,5 @@ proxy_http_version 1.1; proxy_set_header Host $host; +proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_next_upstream off; proxy_redirect off; diff --git a/puppet/zulip_internal/files/nginx/sites-available/loadbalancer b/puppet/zulip_internal/files/nginx/sites-available/loadbalancer index 063a90b7c9..9a4a619c06 100644 --- a/puppet/zulip_internal/files/nginx/sites-available/loadbalancer +++ b/puppet/zulip_internal/files/nginx/sites-available/loadbalancer @@ -31,7 +31,6 @@ server { location ~ /json/get_events|/json/events|/api/v1/events { proxy_pass https://staging/; include /etc/nginx/zulip-include/proxy_longpolling; - proxy_set_header X-Forwarded-For $remote_addr; } } @@ -56,7 +55,6 @@ server { location ~ /json/get_events|/json/events|/api/v1/events { proxy_pass https://prod/; include /etc/nginx/zulip-include/proxy_longpolling; - proxy_set_header X-Forwarded-For $remote_addr; } } @@ -80,7 +78,6 @@ server { location ~ /json/get_events|/json/events|/api/v1/events { proxy_pass https://prod/; include /etc/nginx/zulip-include/proxy_longpolling; - proxy_set_header X-Forwarded-For $remote_addr; } } @@ -105,7 +102,6 @@ server { location ~ /json/get_events|/json/events|/api/v1/events { proxy_pass https://prod/; include /etc/nginx/zulip-include/proxy_longpolling; - proxy_set_header X-Forwarded-For $remote_addr; } } @@ -129,7 +125,6 @@ server { location ~ /json/get_events|/json/events|/api/v1/events { proxy_pass https://prod/; include /etc/nginx/zulip-include/proxy_longpolling; - proxy_set_header X-Forwarded-For $remote_addr; } } @@ -154,7 +149,6 @@ server { location ~ /json/get_events|/json/events|/api/v1/events { proxy_pass https://prod/; include /etc/nginx/zulip-include/proxy_longpolling; - proxy_set_header X-Forwarded-For $remote_addr; } } diff --git a/puppet/zulip_internal/files/nginx/zulip-include/loadbalancer b/puppet/zulip_internal/files/nginx/zulip-include/loadbalancer index 6c50d70a37..e483c44e48 100644 --- a/puppet/zulip_internal/files/nginx/zulip-include/loadbalancer +++ b/puppet/zulip_internal/files/nginx/zulip-include/loadbalancer @@ -1,2 +1 @@ include /etc/nginx/zulip-include/proxy; -proxy_set_header X-Forwarded-For $remote_addr;