Skip to content

Instantly share code, notes, and snippets.

@ElDeveloper
Created October 2, 2014 03:16
Show Gist options
  • Save ElDeveloper/1032a92b2d17e0bfdf8d to your computer and use it in GitHub Desktop.
Save ElDeveloper/1032a92b2d17e0bfdf8d to your computer and use it in GitHub Desktop.
worker_processes 2;
error_log /tmp/error.log;
pid /tmp/nginx.pid;
events {
worker_connections 1024;
}
http {
charset utf-8;
# Enumerate all the Tornado servers here
upstream burgers {
server 127.0.0.1:8888;
}
upstream crumpets {
server 127.0.0.1:7777;
}
upstream frontend {
server 127.0.0.1:6666;
}
default_type application/octet-stream;
access_log /tmp/access.log;
keepalive_timeout 65;
proxy_read_timeout 200;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
gzip on;
gzip_min_length 1000;
gzip_proxied any;
gzip_types text/plain text/css text/xml
application/x-javascript application/xml
application/atom+xml text/javascript;
# 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;
server {
listen 8080;
location ^~ /Users/yoshikivazquezbaeza/.virtualenvs/ag-web/git_sw/american-gut-web/amgut/static/ {
#root /Users/yoshikivazquezbaeza/.virtualenvs/ag-web/git_sw/american-gut-web/amgut/webserver.py;
#if ($query_string) {
# expires max;
#}
}
location / {
if ($query_string) {
expires max;
}
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://127.0.0.1:6666/;
}
location ^~/AmericanGut/ {
if ($query_string) {
expires max;
}
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For http://127.0.0.1:8888/AmericanGut/;
proxy_set_header Host $http_host;
#proxy_redirect false;
#proxy_pass_header Server;
#proxy_set_header Host http://127.0.0.1:8888/AmericanGut/;
#proxy_redirect off;
#proxy_set_header X-Real-IP $remote_addr/AmericanGut/;
#proxy_set_header X-Scheme $scheme;
proxy_pass http://127.0.0.1:8888/;
}
location ^~/BritishGut/ {
if ($query_string) {
expires max;
}
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://127.0.0.1:7777/;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment