2010-09-14 17:04:27 +00:00
|
|
|
server {
|
|
|
|
listen 80 default;
|
|
|
|
#server_name pandora.example.com;
|
|
|
|
|
|
|
|
access_log /var/log/nginx/pandora.access.log;
|
|
|
|
error_log /var/log/nginx/pandora.error.log;
|
|
|
|
|
|
|
|
location /admin/media {
|
|
|
|
root __PREFIX__/src/django/django/contrib;
|
|
|
|
autoindex on;
|
|
|
|
}
|
|
|
|
location /favicon.ico {
|
2010-11-28 15:06:48 +00:00
|
|
|
root __PREFIX__/static;
|
2010-09-14 17:04:27 +00:00
|
|
|
}
|
|
|
|
|
2010-11-28 15:06:48 +00:00
|
|
|
location /static/ {
|
|
|
|
root __PREFIX__;
|
2010-09-14 17:04:27 +00:00
|
|
|
autoindex on;
|
|
|
|
}
|
2010-11-28 15:06:48 +00:00
|
|
|
location /data/ {
|
2010-09-14 17:04:27 +00:00
|
|
|
internal;
|
2010-11-28 15:06:48 +00:00
|
|
|
root __PREFIX__;
|
2010-09-14 17:04:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
location / {
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
proxy_set_header Host $http_host;
|
|
|
|
proxy_redirect 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) {
|
2010-11-28 15:06:48 +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
|
|
|
}
|
|
|
|
|
|
|
|
error_page 404 /404.html;
|
|
|
|
location /404.html {
|
2010-11-30 13:45:13 +00:00
|
|
|
root __PREFIX__/static;
|
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 {
|
2010-11-28 15:06:48 +00:00
|
|
|
root __PREFIX__/static;
|
2010-09-14 17:04:27 +00:00
|
|
|
}
|
|
|
|
}
|