nginx.conf 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. # run nginx in foreground
  2. daemon off;
  3. pid /run/nginx/nginx.pid;
  4. user npm;
  5. # Set number of worker processes automatically based on number of CPU cores.
  6. worker_processes auto;
  7. # Enables the use of JIT for regular expressions to speed-up their processing.
  8. pcre_jit on;
  9. error_log /data/logs/fallback_error.log warn;
  10. # Includes files with directives to load dynamic modules.
  11. include /etc/nginx/modules/*.conf;
  12. events {
  13. include /data/nginx/custom/events[.]conf;
  14. }
  15. http {
  16. include /etc/nginx/mime.types;
  17. default_type application/octet-stream;
  18. sendfile on;
  19. server_tokens off;
  20. tcp_nopush on;
  21. tcp_nodelay on;
  22. client_body_temp_path /tmp/nginx/body 1 2;
  23. keepalive_timeout 90s;
  24. proxy_connect_timeout 90s;
  25. proxy_send_timeout 90s;
  26. proxy_read_timeout 90s;
  27. ssl_prefer_server_ciphers on;
  28. gzip on;
  29. proxy_ignore_client_abort off;
  30. client_max_body_size 2000m;
  31. server_names_hash_bucket_size 1024;
  32. proxy_http_version 1.1;
  33. proxy_set_header X-Forwarded-Scheme $scheme;
  34. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  35. proxy_set_header Accept-Encoding "";
  36. proxy_cache off;
  37. proxy_cache_path /var/lib/nginx/cache/public levels=1:2 keys_zone=public-cache:30m max_size=192m;
  38. proxy_cache_path /var/lib/nginx/cache/private levels=1:2 keys_zone=private-cache:5m max_size=1024m;
  39. # Log format and fallback log file
  40. include /etc/nginx/conf.d/include/log.conf;
  41. # Dynamically generated resolvers file
  42. include /etc/nginx/conf.d/include/resolvers.conf;
  43. # Default upstream scheme
  44. map $host $forward_scheme {
  45. default http;
  46. }
  47. # Real IP Determination
  48. # Local subnets:
  49. set_real_ip_from 10.0.0.0/8;
  50. set_real_ip_from 172.16.0.0/12; # Includes Docker subnet
  51. set_real_ip_from 192.168.0.0/16;
  52. # NPM generated CDN ip ranges:
  53. include conf.d/include/ip_ranges.conf;
  54. # always put the following 2 lines after ip subnets:
  55. real_ip_header X-Real-IP;
  56. real_ip_recursive on;
  57. # Custom
  58. include /data/nginx/custom/http_top[.]conf;
  59. # Files generated by NPM
  60. include /etc/nginx/conf.d/*.conf;
  61. include /data/nginx/default_host/*.conf;
  62. include /data/nginx/proxy_host/*.conf;
  63. include /data/nginx/redirection_host/*.conf;
  64. include /data/nginx/dead_host/*.conf;
  65. include /data/nginx/temp/*.conf;
  66. # Custom
  67. include /data/nginx/custom/http[.]conf;
  68. }
  69. stream {
  70. # Files generated by NPM
  71. include /data/nginx/stream/*.conf;
  72. # Custom
  73. include /data/nginx/custom/stream[.]conf;
  74. }
  75. # Custom
  76. include /data/nginx/custom/root[.]conf;