NewsBlur/config/nginx.newsblur.conf

82 lines
1.9 KiB
Text
Raw Normal View History

server {
server_name newsblur.com;
2012-02-08 12:42:19 -08:00
rewrite ^(.*) http://www.newsblur.com$1 permanent;
}
upstream app_server {
server 127.0.0.1:8000 fail_timeout=10 max_fails=3 ;
2012-01-21 16:50:57 -08:00
server app02.newsblur.com:80 fail_timeout=10 max_fails=3 down;
}
2012-01-21 16:50:57 -08:00
server {
2012-02-08 12:42:19 -08:00
listen 80;
listen 443 default_server ssl;
2012-01-21 16:50:57 -08:00
2012-02-08 12:42:19 -08:00
ssl_certificate /home/sclay/newsblur/config/certificates/www.newsblur.com.crt;
ssl_certificate_key /home/sclay/newsblur/config/certificates/www.newsblur.com.key;
2012-01-21 16:50:57 -08:00
client_max_body_size 4M;
2012-02-08 12:42:19 -08:00
server_name app02.newsblur.com;
# if ($host = 'newsblur.com') {
# rewrite ^/(.*)$ https://app02.newsblur.com/$1 permanent;
# }
error_page 503 @maintenance;
location @maintenance {
rewrite ^(.*)$ /home/sclay/newsblur/media/maintenance.html break;
}
2012-02-08 12:42:19 -08:00
location /media/ {
expires max;
keepalive_timeout 1;
root /home/sclay/newsblur;
2011-11-07 10:02:09 -08:00
}
2011-11-07 10:02:09 -08:00
location /static/ {
expires max;
keepalive_timeout 1;
root /home/sclay/newsblur;
}
location /favicon.ico {
alias /home/sclay/newsblur/media/img/favicon.png;
2012-02-08 12:42:19 -08:00
expires max;
access_log off;
}
location ^~ /crossdomain.xml {
expires max;
alias /home/sclay/newsblur/media/crossdomain.xml;
types {
text/x-cross-domain-policy xml;
}
}
location ^~ /robots.txt {
expires max;
alias /home/sclay/newsblur/media/robots.txt;
}
location /munin/ {
alias /var/cache/munin/www/;
}
location / {
if (-f /home/sclay/newsblur/media/maintenance.html) {
return 503;
}
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
if (!-f $request_filename) {
proxy_pass http://app_server;
break;
}
}
}