2010-09-14 17:04:27 +00:00
|
|
|
server {
|
2011-12-27 13:21:22 +00:00
|
|
|
#make sure to add
|
|
|
|
# application/json json;
|
|
|
|
#to /etc/nginx/mime.types
|
|
|
|
|
2011-08-11 14:15:43 +00:00
|
|
|
#those need to go into /etc/nginx/nginx.conf in the http section
|
|
|
|
#gzip on;
|
2012-01-02 12:53:46 +00:00
|
|
|
#gzip_static on;
|
2011-08-11 14:15:43 +00:00
|
|
|
#gzip_http_version 1.1;
|
|
|
|
#gzip_vary on;
|
|
|
|
#gzip_comp_level 6;
|
|
|
|
#gzip_proxied any;
|
2011-12-27 13:21:22 +00:00
|
|
|
#gzip_types text/plain text/css application/json text/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript text/x-js;
|
2011-08-11 14:15:43 +00:00
|
|
|
#gzip_buffers 16 8k;
|
|
|
|
#gzip_disable "MSIE [1-6]\.(?!.*SV1)";
|
2012-10-30 10:23:36 +00:00
|
|
|
|
|
|
|
#server_name pandora.YOURDOMAIN.COM;
|
2011-08-11 14:15:43 +00:00
|
|
|
|
2010-09-14 17:04:27 +00:00
|
|
|
listen 80 default;
|
|
|
|
|
|
|
|
access_log /var/log/nginx/pandora.access.log;
|
|
|
|
error_log /var/log/nginx/pandora.error.log;
|
|
|
|
|
|
|
|
location /favicon.ico {
|
2012-10-30 10:23:36 +00:00
|
|
|
root /srv/pandora/static;
|
2010-09-14 17:04:27 +00:00
|
|
|
}
|
|
|
|
|
2010-11-28 15:06:48 +00:00
|
|
|
location /static/ {
|
2012-10-30 10:23:36 +00:00
|
|
|
root /srv/pandora;
|
|
|
|
autoindex off;
|
2010-09-14 17:04:27 +00:00
|
|
|
}
|
2010-11-28 15:06:48 +00:00
|
|
|
location /data/ {
|
2010-09-14 17:04:27 +00:00
|
|
|
internal;
|
2012-10-30 10:23:36 +00:00
|
|
|
root /srv/pandora;
|
2010-09-14 17:04:27 +00:00
|
|
|
}
|
|
|
|
|
2015-04-28 17:35:15 +00:00
|
|
|
location /api/ws/ {
|
|
|
|
proxy_http_version 1.1;
|
|
|
|
proxy_set_header Host $http_host;
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
|
|
proxy_set_header Connection "upgrade";
|
2016-07-19 13:43:04 +00:00
|
|
|
proxy_set_header Proxy "";
|
2015-04-28 17:35:15 +00:00
|
|
|
proxy_redirect off;
|
2015-05-18 09:43:14 +00:00
|
|
|
proxy_buffering off;
|
2015-04-28 17:35:15 +00:00
|
|
|
proxy_read_timeout 999999999;
|
2015-05-18 09:43:14 +00:00
|
|
|
proxy_pass http://127.0.0.1:2622/;
|
2015-04-28 17:35:15 +00:00
|
|
|
}
|
|
|
|
|
2010-09-14 17:04:27 +00:00
|
|
|
location / {
|
2013-09-03 13:48:36 +00:00
|
|
|
proxy_set_header X-Forwarded-For $remote_addr;
|
2013-02-09 19:35:11 +00:00
|
|
|
proxy_set_header X-Forwarded-Proto http;
|
2010-09-14 17:04:27 +00:00
|
|
|
proxy_set_header Host $http_host;
|
2016-07-19 13:43:04 +00:00
|
|
|
proxy_set_header Proxy "";
|
2010-09-14 17:04:27 +00:00
|
|
|
proxy_redirect off;
|
2015-05-18 09:43:14 +00:00
|
|
|
proxy_buffering off;
|
2010-12-23 12:30:10 +00:00
|
|
|
proxy_read_timeout 90; #should be in sync with gunicorn timeout
|
|
|
|
proxy_connect_timeout 90; #should be in sync with gunicorn timeout
|
2010-09-14 17:04:27 +00:00
|
|
|
if (!-f $request_filename) {
|
2013-02-02 14:23:44 +00:00
|
|
|
proxy_pass http://127.0.0.1:2620;
|
2010-09-14 17:04:27 +00:00
|
|
|
break;
|
|
|
|
}
|
2010-12-01 00:41:17 +00:00
|
|
|
client_max_body_size 32m;
|
2010-09-14 17:04:27 +00:00
|
|
|
}
|
|
|
|
|
2013-08-26 19:34:52 +00:00
|
|
|
error_page 400 /;
|
2010-09-14 17:04:27 +00:00
|
|
|
error_page 404 /404.html;
|
|
|
|
location /404.html {
|
2012-10-30 10:23:36 +00:00
|
|
|
root /srv/pandora/static/html;
|
2010-09-14 17:04:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# redirect server error pages to the static page /50x.html
|
|
|
|
error_page 500 502 503 504 /50x.html;
|
|
|
|
location /50x.html {
|
2012-10-30 10:23:36 +00:00
|
|
|
root /srv/pandora/static/html;
|
2010-09-14 17:04:27 +00:00
|
|
|
}
|
|
|
|
}
|