nginx.conf 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. user nginx;
  2. # Set number of worker processes automatically based on number of CPU cores.
  3. worker_processes auto;
  4. # Enables the use of JIT for regular expressions to speed-up their processing.
  5. pcre_jit on;
  6. # Configures default error logger.
  7. error_log /var/log/nginx/error.log warn;
  8. # Includes files with directives to load dynamic modules.
  9. include /etc/nginx/modules/*.conf;
  10. events {
  11. use epoll;
  12. worker_connections 102400;
  13. }
  14. http {
  15. # Includes mapping of file name extensions to MIME types of responses
  16. # and defines the default type.
  17. include /etc/nginx/mime.types;
  18. default_type application/octet-stream;
  19. # Name servers used to resolve names of upstream servers into addresses.
  20. # It's also needed when using tcpsocket and udpsocket in Lua modules.
  21. #resolver 208.67.222.222 208.67.220.220;
  22. # Don't tell nginx version to clients.
  23. server_tokens off;
  24. # Specifies the maximum accepted body size of a client request, as
  25. # indicated by the request header Content-Length. If the stated content
  26. # length is greater than this size, then the client receives the HTTP
  27. # error code 413. Set to 0 to disable.
  28. client_max_body_size 10m;
  29. # Timeout for keep-alive connections. Server will close connections after
  30. # this time.
  31. keepalive_timeout 120;
  32. # Sendfile copies data between one FD and other from within the kernel,
  33. # which is more efficient than read() + write().
  34. sendfile on;
  35. # Don't buffer data-sends (disable Nagle algorithm).
  36. # Good for sending frequent small bursts of data in real time.
  37. tcp_nodelay on;
  38. # Causes nginx to attempt to send its HTTP response head in one packet,
  39. # instead of using partial frames.
  40. #tcp_nopush on;
  41. fastcgi_cache_path /etc/nginx/fastcgi_cache levels=1:2 keys_zone=TEST:10m inactive=5m;
  42. fastcgi_temp_path /etc/nginx/temp;
  43. fastcgi_connect_timeout 300;
  44. fastcgi_send_timeout 300;
  45. fastcgi_read_timeout 300;
  46. fastcgi_buffer_size 64k;
  47. fastcgi_buffers 4 64k;
  48. fastcgi_busy_buffers_size 128k;
  49. fastcgi_temp_file_write_size 128k;
  50. # Path of the file with Diffie-Hellman parameters for EDH ciphers.
  51. #ssl_dhparam /etc/ssl/nginx/dh2048.pem;
  52. # Specifies that our cipher suits should be preferred over client ciphers.
  53. ssl_prefer_server_ciphers on;
  54. # Enables a shared SSL cache with size that can hold around 8000 sessions.
  55. ssl_session_cache shared:SSL:2m;
  56. server_names_hash_bucket_size 128;
  57. client_header_buffer_size 32k;
  58. large_client_header_buffers 4 32k;
  59. # Enable gzipping of responses.
  60. gzip on;
  61. gzip_min_length 1k;
  62. gzip_buffers 4 16k;
  63. gzip_http_version 1.0;
  64. gzip_comp_level 2;
  65. gzip_types text/plain application/javascript application/x-javascript text/css text/javascript application/x-httpd-php image/jpeg image/gif image/png application/xml;
  66. # Set the Vary HTTP header as defined in the RFC 2616.
  67. gzip_vary on;
  68. # Enable checking the existence of precompressed files.
  69. #gzip_static on;
  70. log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  71. '$status $body_bytes_sent "$http_referer" '
  72. '"$http_user_agent" "$http_x_forwarded_for"';
  73. # Includes virtual hosts configs.
  74. include /etc/nginx/conf.d/*.conf;
  75. }