user root;
worker_processes1;
error_log/var/nginx_error.log;
pid/var/run/nginx.pid;
events {
worker_connections51200;
use epoll;
}
http {#Enumerate all the Tornado servers hereupstream frontends {
server127.0.0.1:8081;
server127.0.0.1:8082;
server127.0.0.1:8083;
server127.0.0.1:8084;
}#include /etc/nginx/mime.types;default_type application/octet-stream;
access_log/var/log/nginx/access22.log;
keepalive_timeout65;
proxy_read_timeout200;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
gzip on;
gzip_min_length1000;
gzip_proxied any;
gzip_types text/plain text/html 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 {
listen8085;#Allow file uploadsclient_max_body_size 50M;
location^~/static/{
root/var/www;if($query_string) {
expires max;
}
}
location=/favicon.ico {
rewrite (.*)/static/favicon.ico;
}
location=/robots.txt {
rewrite (.*)/static/robots.txt;
}
location/{
proxy_pass_header Server;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_pass http://frontends;
}
}
}