nginx.conf 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. user root root;
  2. worker_processes 1;
  3. worker_rlimit_nofile 20000;
  4. error_log /var/log/nginx/error.log notice;
  5. events {
  6. use epoll;
  7. worker_connections 20000;
  8. multi_accept on;
  9. }
  10. http {
  11. include mime.types;
  12. default_type application/octet-stream;
  13. log_format main
  14. '{"time_iso8601":"$time_iso8601",'
  15. '"remote_addr":"$remote_addr",'
  16. '"request":"$request",'
  17. '"status":$status,'
  18. '"request_method": "$request_method",'
  19. '"body_bytes_sent":$body_bytes_sent,'
  20. '"request_time":$request_time,'
  21. '"upstream_response_time":$upstream_response_time,'
  22. '"upstream_addr":"$upstream_addr",'
  23. '"host":"$host",'
  24. '"url":"$uri",'
  25. '"http_x_forwarded_for":"$http_x_forwarded_for",'
  26. '"http_referer":"$http_referer",'
  27. '"http_user_agent":"$http_user_agent"}';
  28. sendfile on;
  29. tcp_nopush on;
  30. tcp_nodelay on;
  31. server_tokens off;
  32. types_hash_max_size 4096;
  33. server_names_hash_bucket_size 128;
  34. keepalive_timeout 0;
  35. client_max_body_size 0;
  36. gzip on;
  37. gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png application/vnd.ms-fontobject font/ttf font/opentype font/x-woff image/svg+xml;
  38. gzip_min_length 1k;
  39. gzip_comp_level 1;
  40. gzip_buffers 32 4k;
  41. map $http_connection $connection_upgrade {
  42. "~*Upgrade" $http_connection;
  43. default keep-alive;
  44. }
  45. include conf.d/*.conf;
  46. }