mirror of
https://github.com/zulip/zulip.git
synced 2025-11-12 18:06:44 +00:00
This requires manual steps on deploy to each of staging and prod: (1) Run the new update-deployment code to setup the initial deployment directory. (2) Restart all the programs running in screen sessions. (3) Deploy the nginx changes and restart nginx. (imported from commit 1ffe27933ee79274dc0a93d35c9938712de0ef36)
36 lines
1.1 KiB
Plaintext
36 lines
1.1 KiB
Plaintext
access_log /var/log/nginx/humbug.access.log;
|
|
error_log /var/log/nginx/humbug.error.log;
|
|
|
|
# Enable HSTS: tell browsers to always use HTTPS
|
|
add_header Strict-Transport-Security max-age=15768000;
|
|
|
|
# Serve a custom error page when the app is down
|
|
error_page 502 503 504 /static/html/5xx.html;
|
|
|
|
# Serve static files directly
|
|
location /static/ {
|
|
alias /home/humbug/humbug-deployments/current/prod-static/serve/;
|
|
error_page 404 /static/html/404.html;
|
|
}
|
|
|
|
# Send longpoll requests to Tornado
|
|
location ~ /json/get_updates|/api/v1/get_messages|/api/v1/messages/latest|/json/get_events|/api/v1/events {
|
|
proxy_pass http://localhost:9993;
|
|
proxy_redirect off;
|
|
|
|
# Needed for longpolling
|
|
proxy_buffering off;
|
|
proxy_read_timeout 1200;
|
|
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
}
|
|
|
|
# Send everything else to Django via FastCGI
|
|
location / {
|
|
include fastcgi_params;
|
|
fastcgi_pass unix:/home/humbug/humbug-deployments/current/fastcgi-socket;
|
|
fastcgi_split_path_info ^()(.*)$;
|
|
}
|