Skip to content

Instantly share code, notes, and snippets.

@agness
Created May 31, 2013 15:51
Show Gist options
  • Save agness/5685941 to your computer and use it in GitHub Desktop.
Save agness/5685941 to your computer and use it in GitHub Desktop.
Vanilla nginx.conf to work with upstream (Tornado) instances.
# one worker per CPU core
worker_processes 1;
events {
worker_connections 1024;
}
http {
# enumerate Tornado servers here
upstream main {
server 127.0.0.1:8888;
}
# basic options
default_type application/octet-stream;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
gzip on;
proxy_next_upstream error;
server {
listen 80;
server_name localhost;
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://main;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment