Advertisement
Guest User

nginx.conf

a guest
Jan 28th, 2015
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.61 KB | None | 0 0
  1. worker_processes 1;
  2. error_log stderr notice;
  3. daemon off;
  4.  
  5. env DUWAMISH_GUNICORN_PORT;
  6.  
  7. events {
  8. worker_connections 1024;
  9. }
  10.  
  11. http {
  12.  
  13. ##
  14. # Basic Settings
  15. ##
  16.  
  17. #sendfile on;
  18. #tcp_nopush on;
  19. #tcp_nodelay on;
  20. #keepalive_timeout 65;
  21. #types_hash_max_size 2048;
  22. # server_tokens off;
  23.  
  24. # server_names_hash_bucket_size 64;
  25. # server_name_in_redirect off;
  26.  
  27. # include /etc/nginx/mime.types;
  28. include /usr/local/openresty/nginx/conf/mime.types;
  29. # default_type application/octet-stream;
  30. charset utf-8;
  31.  
  32. ##
  33. # Logging Settings
  34. ##
  35.  
  36. access_log /var/log/nginx/access.log;
  37. error_log /var/log/nginx/error.log;
  38.  
  39. ##
  40. # Gzip Settings
  41. ##
  42.  
  43. # gzip on;
  44. # gzip_disable "msie6";
  45.  
  46. # gzip_vary on;
  47. # gzip_proxied any;
  48. # gzip_comp_level 6;
  49. # gzip_buffers 16 8k;
  50. # gzip_http_version 1.1;
  51. # gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
  52.  
  53. # upstream django {
  54. # # set_by_lua $server_location 'return os.getenv("DUWAMISH-GUNICORN_PORT")';
  55. # server $server_location;
  56. # }
  57.  
  58.  
  59. ##
  60. # nginx-naxsi config
  61. ##
  62. # Uncomment it if you installed nginx-naxsi
  63. ##
  64.  
  65. # include /etc/nginx/naxsi_core.rules;
  66.  
  67. ##
  68. # Virtual Host Configs
  69. #
  70.  
  71. # include /etc/nginx/conf.d/*.conf;
  72. # include /etc/nginx/sites-enabled/*;
  73. server {
  74. listen 80;
  75. server_name dev.heyduwamish.org;
  76. # root /home/lucas/duwamish-dev/public;
  77.  
  78. access_log /var/log/nginx/server_access.log;
  79. error_log /var/log/nginx/server_error.log;
  80.  
  81. location /static/ {
  82. alias /duwamish/staticfiles;
  83. }
  84.  
  85. location / {
  86. # an HTTP header important enough to have its own Wikipedia entry:
  87. # http://en.wikipedia.org/wiki/X-Forwarded-For
  88. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  89.  
  90. # enable this if and only if you use HTTPS, this helps Rack
  91. # set the proper protocol for doing redirects:
  92. # proxy_set_header X-Forwarded-Proto https;
  93.  
  94. # pass the Host: header from the client right along so redirects
  95. # can be set properly within the Rack application
  96. proxy_set_header Host $http_host;
  97.  
  98. # we don't want nginx trying to do something clever with
  99. # redirects, we set the Host: header above already.
  100. proxy_redirect off;
  101.  
  102. # Try to serve static files from nginx, no point in making an
  103. # *application* server like Unicorn/Rainbows! serve static files.
  104. # if (!-f $request_filename) {
  105. # # proxy_pass http://hello_app_server;
  106. # proxy_pass http://django;
  107. # break;
  108. # }
  109. set_by_lua $server_location 'return os.getenv("DUWAMISH_GUNICORN_PORT")';
  110. # try_files $server_location $uri @django;
  111. proxy_pass $server_location;
  112. }
  113.  
  114. # location @django {
  115. # proxy_pass http://django;
  116. # }
  117.  
  118. }
  119. }
  120.  
  121. # mail {
  122. # # See sample authentication script at:
  123. # # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
  124. #
  125. # # auth_http localhost/auth.php;
  126. # # pop3_capabilities "TOP" "USER";
  127. # # imap_capabilities "IMAP4rev1" "UIDPLUS";
  128. #
  129. # server {
  130. # listen localhost:110;
  131. # protocol pop3;
  132. # }
  133. #
  134. # server {
  135. # listen localhost:143;
  136. # protocol imap;
  137. # proxy on;
  138. # }
  139. # }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement