Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
172 lines (147 sloc) 4.72 KB
# Enumerate all the Tornado servers here, USE NON-PUBLIC PORT
upstream instantfm-frontends {
server 127.0.0.1:7000;
}
server {
listen 50.116.11.184:80 deferred;
server_name instantfm.com;
# Allow file uploads
client_max_body_size 50M;
# Path for static files
root /home/feross/www/instantfm.com/publish/static;
index index.html;
# Static assets
location ~* ^.+\.(manifest|appcache)$ {
expires -1;
root /home/feross/www/instantfm.com/publish/static;
access_log /home/feross/www/log/nginx/static.log;
}
# Set expires max on static file types
location ~* ^.+\.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|woff|eot|mp4|ogg|ogv|webm)$ {
expires max;
root /home/feross/www/instantfm.com/publish/static;
access_log off;
}
# Only retry if there was a communication error, not a timeout
# on the Tornado server (to avoid propagating "queries of death"
# to all frontends)
proxy_next_upstream error;
# Opt-in to the future
add_header "X-UA-Compatible" "IE=Edge,chrome=1";
# Try to serve static files
try_files $uri $uri/ @tornado;
# Also serve the root from tornado
location = / {
proxy_pass_header Server;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_pass http://instantfm-frontends;
}
# If there is no static file, send it to Tornado
location @tornado {
proxy_pass_header Server;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_pass http://instantfm-frontends;
}
}
server {
listen 50.116.11.184:80;
server_name www.instantfm.com instant.fm www.instant.fm;
rewrite ^ http://instantfm.com$request_uri permanent;
}
################################################################
# dev.instantfm.com
################################################################
upstream dev-instantfm-frontends {
server 127.0.0.1:7010;
}
server {
listen 50.116.11.184:80;
server_name dev.instantfm.com;
auth_basic "Secret";
auth_basic_user_file /home/feross/www/AUTH/.htpasswd-dev.instantfm.com;
# Allow file uploads
client_max_body_size 50M;
root /home/feross/www/dev.instantfm.com/static;
index index.html;
# Try to serve static files
try_files $uri $uri/ @tornado;
# Also serve the root from tornado
location = / {
proxy_pass_header Server;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_pass http://dev-instantfm-frontends;
}
# If there is no static file, send it to Tornado
location @tornado {
proxy_pass_header Server;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_pass http://dev-instantfm-frontends;
}
}
server {
listen 50.116.11.184:80;
server_name www.dev.instantfm.com;
rewrite ^ http://dev.instantfm.com$request_uri permanent;
}
################################################################
# dinkydogg.instant.fm
################################################################
#
# upstream dinkydogg-frontends {
# server localhost:7200;
# }
#
# server {
# listen 50.116.11.184:80;
# server_name dinkydogg.instant.fm;
#
# auth_basic "Secret";
# auth_basic_user_file /home/feross/www/.htpasswd-dev.instant.;
#
# # Allow file uploads
# client_max_body_size 50M;
#
# root /home/feross/www/dinkydogg.instant.fm/static;
# index index.html;
#
# # Try to serve static files
# try_files $uri $uri/ @tornado;
#
# # Also serve the root from tornado
# location = / {
# proxy_pass_header Server;
# proxy_set_header Host $http_host;
# proxy_redirect off;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Scheme $scheme;
# proxy_pass http://dinkydogg-frontends;
# }
#
# # If there is no static file, send it to Tornado
# location @tornado {
# proxy_pass_header Server;
# proxy_set_header Host $http_host;
# proxy_redirect off;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Scheme $scheme;
# proxy_pass http://dinkydogg-frontends;
# }
# }
#
# server {
# listen 50.116.11.184:80;
# server_name www.dinkydogg.instant.fm;
# rewrite ^ http://dinkydogg.instant.fm$request_uri permanent;
# }
Something went wrong with that request. Please try again.