Created
May 31, 2013 15:51
-
-
Save agness/5685941 to your computer and use it in GitHub Desktop.
Vanilla nginx.conf to work with upstream (Tornado) instances.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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