aka40

Nginx global configuration.

Feb 13th, 2014
73
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. user nobody;
  2. # no need for more workers in the proxy mode
  3. worker_processes 2;
  4. error_log /var/log/nginx/error.log info;
  5. worker_rlimit_nofile 20480;
  6. events {
  7. worker_connections 5120; # increase for busier servers
  8. use epoll; # you should use epoll here for Linux kernels 2.6.x
  9. }
  10.  
  11. http {
  12. server_name_in_redirect off;
  13. server_names_hash_max_size 10240;
  14. server_names_hash_bucket_size 1024;
  15. include mime.types;
  16. default_type application/octet-stream;
  17. server_tokens off;
  18.  
  19. # remove/commentout disable_symlinks if_not_owner;if you get Permission denied error
  20. # disable_symlinks if_not_owner;
  21. sendfile on;
  22. tcp_nopush on;
  23. tcp_nodelay on;
  24. keepalive_timeout 5;
  25. types_hash_max_size 2048;
  26.  
  27. # enable gzip
  28. gzip on;
  29. gzip_vary on;
  30. gzip_disable "MSIE [1-6]\.";
  31. gzip_proxied any;
  32. gzip_http_version 1.1;
  33. gzip_min_length 1000;
  34. gzip_comp_level 6;
  35. gzip_buffers 16 8k;
  36. gzip_types text/plain text/xml text/css application/x-javascript application/xml image/png image/x-icon image/gif image/jpeg application/xml+rss text/javascript application/atom+xml;
  37. ignore_invalid_headers on;
  38. client_header_timeout 3m;
  39. client_body_timeout 3m;
  40. send_timeout 3m;
  41. reset_timedout_connection on;
  42. connection_pool_size 256;
  43. client_header_buffer_size 256k;
  44. large_client_header_buffers 4 256k;
  45. client_max_body_size 200M;
  46. client_body_buffer_size 128k;
  47. request_pool_size 32k;
  48. output_buffers 4 32k;
  49. postpone_output 1460;
  50. proxy_temp_path /tmp/nginx_proxy/;
  51. client_body_in_file_only on;
  52. log_format bytes_log "$msec $bytes_sent .";
  53.  
  54. include "/etc/nginx/vhosts/*";
  55. #include "/etc/nginx/w3total.conf";
  56.  
  57. # cache
  58. open_file_cache max=1000 inactive=20s;
  59. open_file_cache_valid 30s;
  60. open_file_cache_min_uses 2;
  61. open_file_cache_errors on;
  62. keepalive_requests 100000;
  63.  
  64. # Proxy Settings
  65.  
  66. proxy_connect_timeout 90;
  67. proxy_send_timeout 90;
  68. proxy_read_timeout 90;
  69. proxy_buffer_size 4k;
  70. proxy_buffers 4 32k;
  71. proxy_busy_buffers_size 64k;
  72. proxy_temp_file_write_size 64k;
  73.  
  74. limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s;
  75.  
  76. }
RAW Paste Data