nginx: Move common proxy configuration into an include file.

(imported from commit 2ee5afc74fe146f8ee98f18f846342351c61c7f0)
This commit is contained in:
Tim Abbott 2013-12-03 17:10:05 -05:00
parent 3760609f3f
commit 9e24558092
6 changed files with 10 additions and 12 deletions

View File

@ -4,6 +4,5 @@
# identified the user. # identified the user.
location /accounts/login/sso/ { location /accounts/login/sso/ {
proxy_pass https://localhost:8888; proxy_pass https://localhost:8888;
proxy_set_header Host $host; include /etc/nginx/zulip-include/proxy;
proxy_next_upstream off;
} }

View File

@ -16,14 +16,12 @@ location /static/ {
# Send longpoll requests to Tornado # Send longpoll requests to Tornado
location ~ /json/get_events|/json/events|/api/v1/events { location ~ /json/get_events|/json/events|/api/v1/events {
proxy_pass http://localhost:9993; proxy_pass http://localhost:9993;
proxy_redirect off; include /etc/nginx/zulip-include/proxy;
# Needed for longpolling # Needed for longpolling
proxy_buffering off; proxy_buffering off;
proxy_read_timeout 1200; proxy_read_timeout 1200;
proxy_next_upstream off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
} }
@ -31,7 +29,6 @@ location ~ /json/get_events|/json/events|/api/v1/events {
# Send sockjs requests to Tornado # Send sockjs requests to Tornado
location /sockjs { location /sockjs {
proxy_pass http://localhost:9993; proxy_pass http://localhost:9993;
proxy_next_upstream off;
include /etc/nginx/zulip-include/location-sockjs; include /etc/nginx/zulip-include/location-sockjs;
} }

View File

@ -1,12 +1,10 @@
proxy_http_version 1.1; include /etc/nginx/zulip-include/proxy;
# Needed for xhr_streaming transport # Needed for xhr_streaming transport
proxy_buffering off; proxy_buffering off;
proxy_read_timeout 1200; proxy_read_timeout 1200;
proxy_next_upstream off;
proxy_set_header Upgrade $http_upgrade; proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade; proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

View File

@ -0,0 +1,4 @@
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_next_upstream off;
proxy_redirect off;

View File

@ -131,6 +131,6 @@ server {
location / { location / {
proxy_pass http://127.0.0.1:9292/; proxy_pass http://127.0.0.1:9292/;
proxy_next_upstream off; include /etc/nginx/zulip-include/proxy;
} }
} }

View File

@ -1,3 +1,3 @@
proxy_set_header Host $host; include /etc/nginx/zulip-include/proxy;
proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-For $remote_addr;
proxy_next_upstream off; proxy_buffering off;