nginx.conf 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. user nginx;
  2. worker_processes 1;
  3. error_log /var/log/nginx/error.log warn;
  4. pid /var/run/nginx.pid;
  5. events {
  6. worker_connections 1024;
  7. }
  8. http {
  9. include /etc/nginx/mime.types;
  10. default_type application/octet-stream;
  11. log_format main '$remote_addr - $remote_user - $server_name [$time_local] "$request" '
  12. '$status $body_bytes_sent "$http_referer" '
  13. '"$http_user_agent" "$http_x_forwarded_for"';
  14. access_log /var/log/nginx/access.log main;
  15. # copies data between one FD and other from within the kernel
  16. # faster than read() + write()
  17. sendfile on;
  18. # send headers in one piece, it is better than sending them one by one
  19. tcp_nopush on;
  20. # don't buffer data sent, good for small data bursts in real time
  21. tcp_nodelay on;
  22. # reduce the data that needs to be sent over network -- for testing environment
  23. gzip on;
  24. gzip_min_length 10240;
  25. gzip_comp_level 1;
  26. gzip_vary on;
  27. gzip_disable msie6;
  28. gzip_proxied expired no-cache no-store private auth;
  29. gzip_types
  30. # text/html is always compressed by HttpGzipModule
  31. text/css
  32. text/javascript
  33. text/xml
  34. text/plain
  35. text/x-component
  36. application/javascript
  37. application/x-javascript
  38. application/json
  39. application/xml
  40. application/rss+xml
  41. application/atom+xml
  42. font/truetype
  43. font/opentype
  44. application/vnd.ms-fontobject
  45. image/svg+xml;
  46. # allow the server to close connection on non responding client, this will free up memory
  47. reset_timedout_connection on;
  48. # request timed out -- default 60
  49. #client_body_timeout 10;
  50. # if client stop responding, free up memory -- default 60
  51. #send_timeout 2;
  52. # server will close connection after this time -- default 75
  53. keepalive_timeout 60;
  54. # number of requests client can make over keep-alive -- for testing environment
  55. #keepalive_requests 100000;
  56. server_names_hash_bucket_size 64;
  57. include /etc/nginx/conf.d/*.conf;
  58. }