2011-08-26 09:35:02 -07:00
|
|
|
upstream app_server {
|
2011-11-01 10:32:11 -07:00
|
|
|
server 127.0.0.1:8000 fail_timeout=10 max_fails=3 ;
|
|
|
|
}
|
|
|
|
|
2013-03-28 18:13:08 -07:00
|
|
|
upstream icon_server {
|
|
|
|
server 127.0.0.1:3030 fail_timeout=2 max_fails=3;
|
|
|
|
server 127.0.0.1:8000 backup;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-01-21 16:50:57 -08:00
|
|
|
server {
|
2013-03-18 11:32:24 -07:00
|
|
|
listen 80;
|
2013-03-28 19:08:46 -07:00
|
|
|
listen 443 default_server ssl;
|
2012-01-21 16:50:57 -08:00
|
|
|
|
2012-06-26 11:19:53 -07:00
|
|
|
# ssl on;
|
2012-12-21 15:55:25 -08:00
|
|
|
ssl_certificate /srv/newsblur/config/certificates/newsblur.com.crt;
|
|
|
|
ssl_certificate_key /srv/newsblur/config/certificates/newsblur.com.key;
|
2015-03-16 13:53:04 -07:00
|
|
|
ssl_ciphers "ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4";
|
2013-11-16 17:51:01 +08:00
|
|
|
ssl_prefer_server_ciphers on;
|
2015-03-16 13:53:04 -07:00
|
|
|
ssl_session_cache shared:SSL:10m;
|
2013-11-16 17:51:01 +08:00
|
|
|
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
2012-01-21 16:50:57 -08:00
|
|
|
|
2011-08-26 09:35:02 -07:00
|
|
|
client_max_body_size 4M;
|
2015-05-06 21:53:11 -07:00
|
|
|
server_name www.newsblur.com newsblur.com dev.newsblur.com push.newsblur.com *.newsblur.com circularapp.com *.circularapp.com;
|
2013-03-25 11:53:31 -07:00
|
|
|
add_header X-nginx-server nginx_none;
|
2014-05-22 09:21:38 -07:00
|
|
|
|
|
|
|
set_real_ip_from 0.0.0.0/0;
|
|
|
|
real_ip_header X-Forwarded-For;
|
|
|
|
real_ip_recursive on;
|
|
|
|
|
2012-02-08 12:42:19 -08:00
|
|
|
# if ($host = 'newsblur.com') {
|
2012-02-08 12:51:44 -08:00
|
|
|
# rewrite ^/(.*)$ https://www.newsblur.com/$1 permanent;
|
2012-02-08 12:42:19 -08:00
|
|
|
# }
|
2012-12-21 15:55:25 -08:00
|
|
|
|
2012-12-21 15:05:38 -08:00
|
|
|
if (-f /srv/newsblur/templates/maintenance_on.html) {
|
2012-06-26 11:19:53 -07:00
|
|
|
return 503;
|
|
|
|
}
|
|
|
|
|
2013-07-30 18:28:53 -07:00
|
|
|
location = /_nginxchk {
|
|
|
|
return 200;
|
|
|
|
}
|
|
|
|
|
2015-08-03 12:23:49 -07:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2012-06-26 11:19:53 -07:00
|
|
|
error_page 502 @down;
|
|
|
|
location @down {
|
2012-12-21 15:55:25 -08:00
|
|
|
root /srv/newsblur/;
|
2012-06-26 11:19:53 -07:00
|
|
|
rewrite ^(.*)$ /templates/502.html break;
|
|
|
|
}
|
|
|
|
|
2011-11-27 03:07:03 -05:00
|
|
|
error_page 503 @maintenance;
|
|
|
|
location @maintenance {
|
2012-12-21 15:55:25 -08:00
|
|
|
if ($uri !~ ^/media/) {
|
|
|
|
root /srv/newsblur/;
|
|
|
|
rewrite ^(.*)$ /templates/maintenance_on.html break;
|
|
|
|
}
|
|
|
|
root /srv/newsblur;
|
2011-11-27 03:07:03 -05:00
|
|
|
}
|
2012-12-12 17:06:54 -08:00
|
|
|
|
|
|
|
error_page 504 @timeout;
|
|
|
|
location @timeout {
|
2012-12-21 15:55:25 -08:00
|
|
|
root /srv/newsblur/;
|
2012-12-12 17:06:54 -08:00
|
|
|
rewrite ^(.*)$ /templates/502.html break;
|
2011-11-27 03:07:03 -05:00
|
|
|
}
|
2012-02-08 12:42:19 -08:00
|
|
|
|
2011-08-26 09:35:02 -07:00
|
|
|
location /media/ {
|
|
|
|
expires max;
|
|
|
|
keepalive_timeout 1;
|
2012-12-21 15:55:25 -08:00
|
|
|
root /srv/newsblur;
|
2011-11-07 10:02:09 -08:00
|
|
|
}
|
2011-11-24 00:29:57 -05:00
|
|
|
|
2011-11-07 10:02:09 -08:00
|
|
|
location /static/ {
|
|
|
|
expires max;
|
|
|
|
keepalive_timeout 1;
|
2012-12-21 15:55:25 -08:00
|
|
|
root /srv/newsblur;
|
2011-08-26 09:35:02 -07:00
|
|
|
}
|
2011-11-24 00:29:57 -05:00
|
|
|
|
2011-08-26 09:35:02 -07:00
|
|
|
location /favicon.ico {
|
2012-12-21 15:55:25 -08:00
|
|
|
alias /srv/newsblur/media/img/favicon_32.png;
|
2012-06-26 11:19:53 -07:00
|
|
|
expires max;
|
2011-08-26 09:35:02 -07:00
|
|
|
}
|
|
|
|
|
2013-03-17 14:06:17 -07:00
|
|
|
location /maintenance {
|
2013-04-01 12:21:20 -07:00
|
|
|
alias /srv/newsblur/templates/maintenance_on.html;
|
2013-03-17 14:06:17 -07:00
|
|
|
expires max;
|
2015-07-14 17:42:55 -07:00
|
|
|
access_log on;
|
2013-03-17 14:06:17 -07:00
|
|
|
}
|
|
|
|
|
2011-08-26 09:35:02 -07:00
|
|
|
location ^~ /crossdomain.xml {
|
|
|
|
expires max;
|
2012-12-21 15:55:25 -08:00
|
|
|
alias /srv/newsblur/media/crossdomain.xml;
|
2011-08-26 09:35:02 -07:00
|
|
|
types {
|
|
|
|
text/x-cross-domain-policy xml;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
location ^~ /robots.txt {
|
|
|
|
expires max;
|
2012-12-21 15:55:25 -08:00
|
|
|
alias /srv/newsblur/media/robots.txt;
|
2011-08-26 09:35:02 -07:00
|
|
|
}
|
|
|
|
|
2013-03-28 11:16:43 -07:00
|
|
|
location /munin/static/ {
|
|
|
|
alias /etc/munin/static/;
|
|
|
|
}
|
|
|
|
|
2012-02-08 16:22:21 -08:00
|
|
|
location /munin/ {
|
2013-06-23 13:47:19 -07:00
|
|
|
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;
|
2011-08-26 09:35:02 -07:00
|
|
|
}
|
2012-12-24 14:57:43 -08:00
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
2011-08-26 09:35:02 -07:00
|
|
|
|
2012-04-07 14:40:04 -07:00
|
|
|
location ^~ /rss_feeds/icon/ {
|
2013-03-28 18:13:08 -07:00
|
|
|
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;
|
2012-04-07 14:40:04 -07:00
|
|
|
}
|
|
|
|
|
2011-08-26 09:35:02 -07:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-11-18 09:13:30 -08:00
|
|
|
}
|
|
|
|
|