Advertisement
Guest User

Nginx configuration

a guest
Dec 22nd, 2013
636
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.60 KB | None | 0 0
  1. worker_processes 1;
  2.  
  3. error_log logs/error.log;
  4. #error_log logs/error.log notice;
  5. #error_log logs/error.log info;
  6.  
  7. pid logs/nginx.pid;
  8.  
  9.  
  10. events {
  11. worker_connections 1024;
  12. use epoll;
  13. }
  14.  
  15.  
  16. http {
  17. # Enumerate all the Tornado servers here
  18. upstream frontends {
  19. # least_conn;
  20. server pam-picaxe.rhcloud.com:80;
  21. # server 127.8.143.129:15000;
  22. }
  23.  
  24. include mime.types;
  25. default_type application/octet-stream;
  26.  
  27. log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  28. '$status $body_bytes_sent "$http_referer" '
  29. '"$http_user_agent" "$http_x_forwarded_for"';
  30.  
  31. access_log logs/access.log main;
  32.  
  33. keepalive_timeout 65;
  34. proxy_read_timeout 200;
  35. sendfile on;
  36. tcp_nopush on;
  37. tcp_nodelay on;
  38. gzip on;
  39. gzip_min_length 1000;
  40. gzip_proxied any;
  41. gzip_types text/plain text/html text/css text/xml
  42. application/x-javascript application/xml
  43. application/atom+xml text/javascript;
  44.  
  45. # Only retry if there was a communication error, not a timeout
  46. # on the Tornado server (to avoid propagating "queries of death"
  47. # to all frontends)
  48. proxy_next_upstream error;
  49.  
  50. server {
  51. listen 127.8.143.129:8080;
  52. #server_name localhost;
  53. ssl off;
  54. # Allow file uploads
  55. client_max_body_size 10M;
  56.  
  57. #charset koi8-r;
  58.  
  59. #access_log logs/host.access.log main;
  60.  
  61. location ^~ /static/ {
  62. root /blahblah/runtime/repo/static;
  63. if ($query_string) {
  64. expires max;
  65. }
  66. }
  67. location = /favicon.ico {
  68. rewrite (.*) /static/favicon.ico;
  69. }
  70. location = /robots.txt {
  71. rewrite (.*) /static/robots.txt;
  72. }
  73.  
  74. location / {
  75. #proxy_pass_header Server;
  76. #proxy_set_header Host $host;
  77. #proxy_redirect off;
  78. #proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  79. #proxy_set_header X-Real-IP $remote_addr;
  80. #proxy_set_header X-Scheme $scheme;
  81. #proxy_set_header X-Url-Scheme $scheme;
  82. proxy_pass http://frontends;
  83. proxy_redirect off;
  84. proxy_http_version 1.1;
  85. }
  86.  
  87. error_page 404 /404.html;
  88.  
  89. # redirect server error pages to the static page /50x.html
  90. #
  91. error_page 500 502 503 504 /50x.html;
  92. location = /50x.html {
  93. root html;
  94. }
  95. }
  96.  
  97.  
  98. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement