nginx.conf 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #user nginx;
  2. worker_processes 1;
  3. #error_log /var/log/nginx/error.log;
  4. #pid /var/run/nginx.pid;
  5. events {
  6. worker_connections 1024;
  7. use epoll;
  8. }
  9. http {
  10. # Enumerate all the Tornado servers here
  11. upstream frontends {
  12. server 127.0.0.1:8000;
  13. server 127.0.0.1:8001;
  14. server 127.0.0.1:8002;
  15. server 127.0.0.1:8003;
  16. server 127.0.0.1:8004;
  17. server 127.0.0.1:8005;
  18. server 127.0.0.1:8006;
  19. server 127.0.0.1:8007;
  20. }
  21. include /usr/local/nginx/conf/mime.types;
  22. default_type application/octet-stream;
  23. # access_log /var/log/nginx/access.log;
  24. keepalive_timeout 65;
  25. proxy_read_timeout 200;
  26. sendfile on;
  27. tcp_nopush on;
  28. tcp_nodelay on;
  29. #gzip on;
  30. #gzip_min_length 1000;
  31. #gzip_proxied any;
  32. #gzip_types text/plain text/html text/css text/xml
  33. # application/x-javascript application/xml
  34. # application/atom+xml text/javascript;
  35. # Only retry if there was a communication error, not a timeout
  36. # on the Tornado server (to avoid propagating "queries of death"
  37. # to all frontends)
  38. proxy_next_upstream error;
  39. server {
  40. listen 8080;
  41. location / {
  42. proxy_pass_header Server;
  43. proxy_set_header Host $http_host;
  44. proxy_redirect off;
  45. proxy_set_header X-Real-IP $remote_addr;
  46. proxy_set_header X-Scheme $scheme;
  47. proxy_pass http://frontends;
  48. }
  49. }
  50. }