nginx.conf 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 /config/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. access_log /config/logs/default.log proxy;
  43. include /etc/nginx/conf.d/*.conf;
  44. include /config/nginx/*.conf;
  45. }
  46. stream {
  47. include /config/nginx/stream/*.conf;
  48. }