nginx.base 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. user apache;
  2. worker_processes 2;
  3. worker_rlimit_nofile 8192;
  4. worker_priority -5;
  5. timer_resolution 100ms;
  6. error_log /var/log/nginx/error.log info;
  7. pid /var/run/nginx.pid;
  8. env PATH;
  9. events {
  10. worker_connections 4000;
  11. accept_mutex on; # seems, this helps to spread connections across workers
  12. }
  13. http {
  14. include mime.types;
  15. default_type application/octet-stream;
  16. log_format main '$remote_addr - $remote_user [$time_local] $request '
  17. '"$status" $body_bytes_sent "$http_referer" '
  18. '"$http_user_agent" "$http_x_forwarded_for"';
  19. access_log /var/log/nginx/access.log main;
  20. sendfile on;
  21. tcp_nopush on;
  22. keepalive_timeout 10;
  23. tcp_nodelay on;
  24. server_names_hash_bucket_size 128;
  25. gzip on;
  26. gzip_min_length 1100;
  27. gzip_buffers 4 8k;
  28. gzip_proxied any;
  29. gzip_vary on;
  30. gzip_types
  31. application/x-javascript
  32. text/xml
  33. application/atom+xml
  34. application/javascript
  35. application/json
  36. application/rss+xml
  37. application/vnd.ms-fontobject
  38. application/x-font-ttf
  39. application/x-web-app-manifest+json
  40. application/xhtml+xml
  41. application/xml
  42. font/opentype
  43. image/svg+xml
  44. image/x-icon
  45. text/css
  46. text/plain
  47. text/x-component;
  48. output_buffers 8 64k; # buffer for each one request. buffer exempt at the end of request.
  49. postpone_output 1460; # no output to the core, if accumulated less. It allows you to send full-sized TCP packets.
  50. proxy_buffers 64 64k;
  51. proxy_buffer_size 192k;
  52. proxy_max_temp_file_size 0; # zero value disables buffering of responses to temporary files.
  53. proxy_set_header X-Real-IP $remote_addr;
  54. proxy_set_header X-Forwarded-For $remote_addr;
  55. proxy_set_header X-Server-Address $server_addr;
  56. proxy_set_header Host $host;
  57. #proxy_set_header Host $http_host;
  58. proxy_set_header X-Forwarded-Proto $scheme;
  59. proxy_set_header X-Scheme $scheme;
  60. proxy_read_timeout 600;
  61. proxy_send_timeout 600;
  62. open_file_cache max=4000 inactive=60s;
  63. open_file_cache_valid 60s;
  64. open_file_cache_min_uses 2;
  65. open_file_cache_errors on;
  66. client_body_buffer_size 10M;
  67. client_max_body_size 10M;
  68. # limit_conn_zone $binary_remote_addr zone=limit_ips:8m;
  69. # limit_conn limit_ips 48;
  70. server{
  71. listen 127.0.0.1:8000;
  72. server_name 127.0.0.1;
  73. access_log off;
  74. error_log /dev/null;
  75. stub_status on;
  76. }
  77. include /etc/nginx/lcwm2/custom/*.conf;