2013-07-14 05:58:46 +02:00
|
|
|
upstream staging {
|
2016-07-21 07:05:17 +02:00
|
|
|
server staging0.zulipchat.net:443;
|
2013-12-05 22:27:36 +01:00
|
|
|
|
|
|
|
keepalive 10000;
|
2013-07-14 05:58:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
upstream prod {
|
2016-07-21 07:05:17 +02:00
|
|
|
server prod0.zulipchat.net:443;
|
2013-12-05 22:27:36 +01:00
|
|
|
|
|
|
|
keepalive 10000;
|
2013-07-14 05:58:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
server {
|
|
|
|
listen 80;
|
|
|
|
return 301 https://$host$request_uri;
|
|
|
|
}
|
|
|
|
|
|
|
|
server {
|
2016-07-21 07:05:17 +02:00
|
|
|
# The listen needs to be `www.zulipstaging.com` since bare zulipstaging.com
|
|
|
|
# is not a CNAME and thus has the public IP inside EC2
|
|
|
|
listen www.zulipstaging.com:443;
|
|
|
|
server_name zulipstaging.com *.zulipstaging.com;
|
2013-07-14 05:58:46 +02:00
|
|
|
|
|
|
|
ssl on;
|
2016-07-21 07:05:17 +02:00
|
|
|
ssl_certificate /etc/ssl/certs/wildcard-zulipstaging.com.combined-chain.crt;
|
|
|
|
ssl_certificate_key /etc/ssl/private/wildcard-zulipstaging.com.key;
|
2013-07-14 05:58:46 +02:00
|
|
|
|
|
|
|
location / {
|
|
|
|
proxy_pass https://staging/;
|
2013-12-03 23:28:22 +01:00
|
|
|
include /etc/nginx/zulip-include/proxy;
|
2013-07-14 05:58:46 +02:00
|
|
|
}
|
2013-09-25 17:02:46 +02:00
|
|
|
|
|
|
|
location /sockjs {
|
|
|
|
proxy_pass https://staging;
|
|
|
|
include /etc/nginx/zulip-include/location-sockjs;
|
|
|
|
}
|
2013-12-03 23:19:04 +01:00
|
|
|
|
2018-07-13 12:58:16 +02:00
|
|
|
# We don't need /api/v1/events/internal, because that doesn't go through the loadbalancer.
|
2016-10-19 02:51:19 +02:00
|
|
|
location ~ /json/events|/api/v1/events {
|
2013-12-07 13:57:59 +01:00
|
|
|
proxy_pass https://staging;
|
2013-12-03 23:19:04 +01:00
|
|
|
include /etc/nginx/zulip-include/proxy_longpolling;
|
|
|
|
}
|
2017-11-03 23:01:11 +01:00
|
|
|
|
|
|
|
include /etc/nginx/zulip-include/certbot;
|
2013-07-14 05:58:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
server {
|
2016-07-21 07:05:17 +02:00
|
|
|
# The listen needs to be `www.zulipchat.com` since bare zulipchat.com
|
|
|
|
# is not a CNAME and thus has the public IP inside EC2
|
|
|
|
listen www.zulipchat.com:443 default_server;
|
|
|
|
server_name zulipchat.com *.zulipchat.com;
|
2013-07-14 05:58:46 +02:00
|
|
|
|
|
|
|
ssl on;
|
2016-07-21 07:05:17 +02:00
|
|
|
ssl_certificate /etc/ssl/certs/wildcard-zulipchat.com.combined-chain.crt;
|
|
|
|
ssl_certificate_key /etc/ssl/private/wildcard-zulipchat.com.key;
|
2013-07-14 05:58:46 +02:00
|
|
|
|
|
|
|
location / {
|
2013-12-04 17:26:47 +01:00
|
|
|
proxy_pass https://prod;
|
2013-12-03 23:28:22 +01:00
|
|
|
include /etc/nginx/zulip-include/proxy;
|
2013-07-14 05:58:46 +02:00
|
|
|
}
|
2013-09-25 17:02:46 +02:00
|
|
|
|
|
|
|
location /sockjs {
|
|
|
|
proxy_pass https://prod;
|
|
|
|
include /etc/nginx/zulip-include/location-sockjs;
|
|
|
|
}
|
2013-12-03 23:19:04 +01:00
|
|
|
|
2016-10-19 02:51:19 +02:00
|
|
|
location ~ /json/events|/api/v1/events {
|
2013-12-04 17:26:47 +01:00
|
|
|
proxy_pass https://prod;
|
2013-12-03 23:19:04 +01:00
|
|
|
include /etc/nginx/zulip-include/proxy_longpolling;
|
|
|
|
}
|
2017-11-03 23:01:11 +01:00
|
|
|
|
|
|
|
include /etc/nginx/zulip-include/certbot;
|
2013-07-14 05:58:46 +02:00
|
|
|
}
|
|
|
|
|
2013-09-04 21:57:31 +02:00
|
|
|
server {
|
2016-07-21 07:05:17 +02:00
|
|
|
listen uploads.zulipusercontent.net:443;
|
|
|
|
server_name uploads.zulipusercontent.net;
|
2013-09-04 21:57:31 +02:00
|
|
|
|
|
|
|
ssl on;
|
2016-07-21 07:05:17 +02:00
|
|
|
ssl_certificate /etc/letsencrypt/live/uploads.zulipusercontent.net/fullchain.pem;
|
|
|
|
ssl_certificate_key /etc/letsencrypt/live/uploads.zulipusercontent.net/privkey.pem;
|
2013-09-04 21:57:31 +02:00
|
|
|
|
|
|
|
location / {
|
2013-12-04 17:26:47 +01:00
|
|
|
proxy_pass http://127.0.0.1:9292;
|
2013-12-03 23:10:05 +01:00
|
|
|
include /etc/nginx/zulip-include/proxy;
|
2013-09-04 21:57:31 +02:00
|
|
|
}
|
2017-11-03 23:01:11 +01:00
|
|
|
|
|
|
|
include /etc/nginx/zulip-include/certbot;
|
2013-09-04 21:57:31 +02:00
|
|
|
}
|