nginx.conf 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # run nginx in foreground
  2. daemon off;
  3. user root;
  4. # Set number of worker processes automatically based on number of CPU cores.
  5. worker_processes auto;
  6. # Enables the use of JIT for regular expressions to speed-up their processing.
  7. pcre_jit on;
  8. error_log /data/logs/error.log warn;
  9. # Includes files with directives to load dynamic modules.
  10. include /etc/nginx/modules/*.conf;
  11. events {
  12. worker_connections 1024;
  13. }
  14. http {
  15. include /etc/nginx/mime.types;
  16. default_type application/octet-stream;
  17. sendfile on;
  18. server_tokens off;
  19. tcp_nopush on;
  20. tcp_nodelay on;
  21. client_body_temp_path /tmp/nginx/body 1 2;
  22. keepalive_timeout 65;
  23. ssl_prefer_server_ciphers on;
  24. gzip on;
  25. proxy_ignore_client_abort off;
  26. client_max_body_size 2000m;
  27. proxy_http_version 1.1;
  28. proxy_set_header X-Forwarded-Scheme $scheme;
  29. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  30. proxy_set_header Accept-Encoding "";
  31. proxy_cache off;
  32. proxy_cache_path /var/lib/nginx/cache/public levels=1:2 keys_zone=public-cache:30m max_size=192m;
  33. proxy_cache_path /var/lib/nginx/cache/private levels=1:2 keys_zone=private-cache:5m max_size=1024m;
  34. # MISS
  35. # BYPASS
  36. # EXPIRED - expired, request was passed to backend
  37. # UPDATING - expired, stale response was used due to proxy/fastcgi_cache_use_stale updating
  38. # STALE - expired, stale response was used due to proxy/fastcgi_cache_use_stale
  39. # HIT
  40. # - (dash) - request never reached to upstream module. Most likely it was processed at Nginx-level only (e.g. forbidden, redirects, etc) (Ref: Mail Thread
  41. log_format proxy '[$time_local] $upstream_cache_status $upstream_status $status - $request_method $scheme $host "$request_uri" [Client $remote_addr] [Length $body_bytes_sent] [Gzip $gzip_ratio] [Sent-to $server] "$http_user_agent" "$http_referer"';
  42. log_format standard '[$time_local] $status - $request_method $scheme $host "$request_uri" [Client $remote_addr] [Length $body_bytes_sent] [Gzip $gzip_ratio] "$http_user_agent" "$http_referer"';
  43. access_log /data/logs/default.log proxy;
  44. include /etc/nginx/conf.d/*.conf;
  45. include /data/nginx/proxy_host/*.conf;
  46. include /data/nginx/redirection_host/*.conf;
  47. include /data/nginx/dead_host/*.conf;
  48. include /data/nginx/temp/*.conf;
  49. }
  50. stream {
  51. include /data/nginx/stream/*.conf;
  52. }