zulip/puppet/zulip_internal/files/nginx/sites-available/loadbalancer

201 lines
4.8 KiB
Plaintext

upstream staging {
server staging.zulip.net:443;
keepalive 10000;
}
upstream alpha {
server alpha0.zulip.net:443;
keepalive 10000;
}
upstream prod {
server prod0.zulip.net:443;
keepalive 10000;
}
server {
listen 80;
return 301 https://$host$request_uri;
}
server {
listen www.humbughq.com:443;
server_name www.humbughq.com api.humbughq.com humbughq.com;
ssl on;
ssl_certificate /etc/ssl/certs/www.humbughq.com.combined-chain.crt;
ssl_certificate_key /etc/ssl/private/production-zulip.key;
location / {
proxy_pass https://prod;
include /etc/nginx/zulip-include/proxy;
}
location /sockjs {
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;
}
}
server {
listen staging.zulip.com:443;
ssl on;
ssl_certificate /etc/ssl/certs/staging.zulip.com.combined-chain.crt;
ssl_certificate_key /etc/ssl/private/staging-zulip.key;
location / {
proxy_pass https://staging/;
include /etc/nginx/zulip-include/proxy;
}
location /sockjs {
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;
}
}
server {
# This stanza also covers bare zulip.com
listen www.zulip.com:443 default_server;
ssl on;
ssl_certificate /etc/ssl/certs/www.zulip.com.combined-chain.crt;
ssl_certificate_key /etc/ssl/private/production-zulip.key;
location / {
proxy_pass https://prod;
include /etc/nginx/zulip-include/proxy;
}
location /sockjs {
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;
}
}
server {
listen api.zulip.com:443;
ssl on;
ssl_certificate /etc/ssl/certs/api.zulip.com.combined-chain.crt;
ssl_certificate_key /etc/ssl/private/production-zulip.key;
location / {
proxy_pass https://prod;
include /etc/nginx/zulip-include/proxy;
}
location /sockjs {
proxy_pass https://prod;
include /etc/nginx/zulip-include/location-sockjs;
}
# On api.zulip.com, there's an automatic leading /api
location ~ /v1/events {
proxy_pass https://prod;
include /etc/nginx/zulip-include/proxy_longpolling;
}
}
server {
listen zephyr.zulip.com:443;
ssl on;
ssl_certificate /etc/ssl/certs/zephyr.zulip.com.combined-chain.crt;
ssl_certificate_key /etc/ssl/private/production-zulip.key;
location / {
proxy_pass https://prod;
include /etc/nginx/zulip-include/proxy;
}
location /sockjs {
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;
}
}
server {
listen customer29.zulip.com:443;
ssl on;
ssl_certificate /etc/ssl/certs/customer29.zulip.com.combined-chain.crt;
ssl_certificate_key /etc/ssl/private/production-zulip.key;
location / {
proxy_pass https://alpha;
include /etc/nginx/zulip-include/proxy;
}
location /sockjs {
proxy_pass https://alpha;
include /etc/nginx/zulip-include/location-sockjs;
}
location ~ /json/get_events|/json/events|/api/v1/events {
proxy_pass https://alpha;
include /etc/nginx/zulip-include/proxy_longpolling;
}
}
server {
listen 10.0.1.202:443;
ssl on;
ssl_certificate /etc/ssl/certs/wildcard-e.customer29.zulip.com.combined-chain.crt;
ssl_certificate_key /etc/ssl/private/production-zulip.key;
location / {
proxy_pass https://alpha;
include /etc/nginx/zulip-include/proxy;
}
location /sockjs {
proxy_pass https://alpha;
include /etc/nginx/zulip-include/location-sockjs;
}
location ~ /json/get_events|/json/events|/api/v1/events {
proxy_pass https://alpha;
include /etc/nginx/zulip-include/proxy_longpolling;
}
}
server {
listen external-content.zulipcdn.net:443;
ssl on;
ssl_certificate /etc/ssl/certs/external-content.zulipcdn.net.combined-chain.crt;
ssl_certificate_key /etc/ssl/private/production-zulipcdn.key;
location / {
proxy_pass http://127.0.0.1:9292;
include /etc/nginx/zulip-include/proxy;
}
}