From afe167ea58dbfba751a413f666d48596fcf927a6 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Tue, 3 Dec 2013 17:19:04 -0500 Subject: [PATCH] nginx: Use the longpolling proxy configuration on load balancers. (imported from commit f590e6b1eec2856b5128e310797f8ba58846417a) --- .../files/nginx/sites-available/loadbalancer | 36 +++++++++++++++++++ .../files/nginx/zulip-include/loadbalancer | 1 - 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/puppet/zulip_internal/files/nginx/sites-available/loadbalancer b/puppet/zulip_internal/files/nginx/sites-available/loadbalancer index 49e72a3f3c..063a90b7c9 100644 --- a/puppet/zulip_internal/files/nginx/sites-available/loadbalancer +++ b/puppet/zulip_internal/files/nginx/sites-available/loadbalancer @@ -27,6 +27,12 @@ server { proxy_pass https://staging; include /etc/nginx/zulip-include/location-sockjs; } + + 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; + } } server { @@ -46,6 +52,12 @@ server { proxy_pass https://prod; include /etc/nginx/zulip-include/location-sockjs; } + + 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; + } } server { @@ -64,6 +76,12 @@ server { proxy_pass https://staging; include /etc/nginx/zulip-include/location-sockjs; } + + 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; + } } server { @@ -83,6 +101,12 @@ server { proxy_pass https://prod; include /etc/nginx/zulip-include/location-sockjs; } + + 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; + } } server { @@ -101,6 +125,12 @@ server { proxy_pass https://prod; include /etc/nginx/zulip-include/location-sockjs; } + + 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; + } } @@ -120,6 +150,12 @@ server { proxy_pass https://prod; include /etc/nginx/zulip-include/location-sockjs; } + + 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; + } } server { diff --git a/puppet/zulip_internal/files/nginx/zulip-include/loadbalancer b/puppet/zulip_internal/files/nginx/zulip-include/loadbalancer index 48cb9eb7b0..6c50d70a37 100644 --- a/puppet/zulip_internal/files/nginx/zulip-include/loadbalancer +++ b/puppet/zulip_internal/files/nginx/zulip-include/loadbalancer @@ -1,3 +1,2 @@ include /etc/nginx/zulip-include/proxy; proxy_set_header X-Forwarded-For $remote_addr; -proxy_buffering off;