nginx.conf 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. # Custom
  13. include /data/nginx/custom/root_top[.]conf;
  14. events {
  15. include /data/nginx/custom/events[.]conf;
  16. }
  17. http {
  18. include /etc/nginx/mime.types;
  19. default_type application/octet-stream;
  20. sendfile on;
  21. server_tokens off;
  22. tcp_nopush on;
  23. tcp_nodelay on;
  24. client_body_temp_path /tmp/nginx/body 1 2;
  25. keepalive_timeout 90s;
  26. proxy_connect_timeout 90s;
  27. proxy_send_timeout 90s;
  28. proxy_read_timeout 90s;
  29. ssl_prefer_server_ciphers on;
  30. gzip on;
  31. proxy_ignore_client_abort off;
  32. client_max_body_size 2000m;
  33. server_names_hash_bucket_size 1024;
  34. proxy_http_version 1.1;
  35. proxy_set_header X-Forwarded-Scheme $scheme;
  36. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  37. proxy_set_header Accept-Encoding "";
  38. proxy_cache off;
  39. proxy_cache_path /var/lib/nginx/cache/public levels=1:2 keys_zone=public-cache:30m max_size=192m;
  40. proxy_cache_path /var/lib/nginx/cache/private levels=1:2 keys_zone=private-cache:5m max_size=1024m;
  41. # Log format and fallback log file
  42. include /etc/nginx/conf.d/include/log.conf;
  43. # Dynamically generated resolvers file
  44. include /etc/nginx/conf.d/include/resolvers.conf;
  45. # Default upstream scheme
  46. map $host $forward_scheme {
  47. default http;
  48. }
  49. # Real IP Determination
  50. # Local subnets:
  51. set_real_ip_from 10.0.0.0/8;
  52. set_real_ip_from 172.16.0.0/12; # Includes Docker subnet
  53. set_real_ip_from 192.168.0.0/16;
  54. # NPM generated CDN ip ranges:
  55. include conf.d/include/ip_ranges.conf;
  56. # always put the following 2 lines after ip subnets:
  57. real_ip_header X-Real-IP;
  58. real_ip_recursive on;
  59. # Custom
  60. include /data/nginx/custom/http_top[.]conf;
  61. # Files generated by NPM
  62. include /etc/nginx/conf.d/*.conf;
  63. include /data/nginx/default_host/*.conf;
  64. include /data/nginx/proxy_host/*.conf;
  65. include /data/nginx/redirection_host/*.conf;
  66. include /data/nginx/dead_host/*.conf;
  67. include /data/nginx/temp/*.conf;
  68. # Custom
  69. include /data/nginx/custom/http[.]conf;
  70. }
  71. stream {
  72. # Files generated by NPM
  73. include /data/nginx/stream/*.conf;
  74. # Custom
  75. include /data/nginx/custom/stream[.]conf;
  76. }
  77. # Custom
  78. include /data/nginx/custom/root[.]conf;