Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
149 lines (120 sloc) 4.46 KB
upstream app_server {
server 127.0.0.1:8000 fail_timeout=10 max_fails=3 ;
}
upstream icon_server {
server 127.0.0.1:3030 fail_timeout=2 max_fails=3;
server 127.0.0.1:8000 backup;
}
server {
listen 80;
listen 443 default_server ssl;
# ssl on;
ssl_certificate /srv/newsblur/config/certificates/newsblur.com.crt;
ssl_certificate_key /srv/newsblur/config/certificates/newsblur.com.key;
ssl_ciphers "ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA";
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_dhparam /srv/newsblur/config/certificates/dhparams.pem;
client_max_body_size 4M;
server_name www.newsblur.com newsblur.com dev.newsblur.com push.newsblur.com *.newsblur.com circularapp.com *.circularapp.com;
add_header X-nginx-server nginx_none;
set_real_ip_from 0.0.0.0/0;
real_ip_header X-Forwarded-For;
real_ip_recursive on;
# if ($host = 'newsblur.com') {
# rewrite ^/(.*)$ https://www.newsblur.com/$1 permanent;
# }
if (-f /srv/newsblur/templates/maintenance_on.html) {
return 503;
}
location = /_nginxchk {
return 200;
}
location /nginx_status {
stub_status on; # activate stub_status module
access_log off;
allow 127.0.0.1; # restrict access to local only
deny all;
}
error_page 502 @down;
location @down {
root /srv/newsblur/;
rewrite ^(.*)$ /templates/502.html break;
}
error_page 503 @maintenance;
location @maintenance {
if ($uri !~ ^/media/) {
root /srv/newsblur/;
rewrite ^(.*)$ /templates/maintenance_on.html break;
}
root /srv/newsblur;
}
error_page 504 @timeout;
location @timeout {
root /srv/newsblur/;
rewrite ^(.*)$ /templates/502.html break;
}
location /media/ {
expires max;
keepalive_timeout 1;
root /srv/newsblur;
}
location /static/ {
expires max;
keepalive_timeout 1;
root /srv/newsblur;
}
location /favicon.ico {
alias /srv/newsblur/media/img/favicon_32.png;
expires max;
}
location /maintenance {
alias /srv/newsblur/templates/maintenance_on.html;
expires max;
access_log on;
}
location ^~ /crossdomain.xml {
expires max;
alias /srv/newsblur/media/crossdomain.xml;
types {
text/x-cross-domain-policy xml;
}
}
location ^~ /robots.txt {
expires max;
alias /srv/newsblur/media/robots.txt;
}
location /munin/static/ {
alias /etc/munin/static/;
}
location /munin/ {
alias /var/cache/munin/www/;
# fastcgi_split_path_info ^(/munin)(.*);
# fastcgi_param PATH_INFO $fastcgi_path_info;
# fastcgi_pass unix:/var/run/munin/fcgi-html.sock;
# include fastcgi_params;
}
location ^~ /cgi-bin/munin-cgi-graph/ {
fastcgi_split_path_info ^(/cgi-bin/munin-cgi-graph)(.*);
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_pass unix:/var/run/munin/fcgi-graph.sock;
include fastcgi_params;
}
location ^~ /rss_feeds/icon/ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://icon_server;
}
location / {
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;
}
}
}