nginx.conf 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. daemon off;
  2. user www-data;
  3. worker_processes 1;
  4. pid /var/run/nginx.pid;
  5. events {
  6. worker_connections 1024;
  7. }
  8. http {
  9. sendfile on;
  10. tcp_nopush on;
  11. tcp_nodelay on;
  12. keepalive_timeout 65;
  13. types_hash_max_size 2048;
  14. server_tokens off;
  15. server_names_hash_bucket_size 32;
  16. include /etc/nginx/mime.types;
  17. default_type application/octet-stream;
  18. access_log /var/log/nginx/access.log;
  19. error_log /var/log/nginx/error.log;
  20. gzip on;
  21. gzip_disable "msie6";
  22. server {
  23. listen 80 default_server;
  24. server_name _;
  25. open_log_file_cache max=1000 inactive=20s min_uses=2 valid=1m;
  26. location / {
  27. proxy_pass http://127.0.0.1:8000;
  28. proxy_set_header X-Real-IP $remote_addr;
  29. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  30. proxy_set_header X-Forwarded-Proto $scheme;
  31. proxy_set_header X-Forwarded-Server $host;
  32. proxy_set_header X-Forwarded-Host $host;
  33. proxy_set_header Host $host;
  34. client_max_body_size 10m;
  35. client_body_buffer_size 128k;
  36. proxy_connect_timeout 90;
  37. proxy_send_timeout 90;
  38. proxy_read_timeout 90;
  39. proxy_buffer_size 4k;
  40. proxy_buffers 4 32k;
  41. proxy_busy_buffers_size 64k;
  42. proxy_temp_file_write_size 64k;
  43. }
  44. add_header Access-Control-Allow-Origin "*";
  45. add_header Access-Control-Allow-Methods "GET, OPTIONS";
  46. add_header Access-Control-Allow-Headers "origin, authorization, accept";
  47. location /content {
  48. alias /var/lib/graphite/webapp/content;
  49. }
  50. location /media {
  51. alias /usr/share/pyshared/django/contrib/admin/media;
  52. }
  53. }
  54. }