You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

179 lines
4.0 KiB

  1. user www-data;
  2. worker_processes auto;
  3. worker_cpu_affinity auto;
  4. worker_rlimit_nofile 100000;
  5. pid /run/nginx.pid;
  6. pcre_jit on;
  7. events {
  8. multi_accept on;
  9. worker_connections 50000;
  10. accept_mutex on;
  11. use epoll;
  12. }
  13. http
  14. {
  15. ##
  16. # EasyEngine Settings
  17. ##
  18. sendfile on;
  19. sendfile_max_chunk 512k;
  20. tcp_nopush on;
  21. tcp_nodelay on;
  22. keepalive_timeout 8;
  23. keepalive_requests 500;
  24. keepalive_disable msie6;
  25. lingering_time 20s;
  26. lingering_timeout 5s;
  27. server_tokens off;
  28. reset_timedout_connection on;
  29. add_header X-Powered-By "WordOps v3.9.4 - Optimized by VirtuBox";
  30. add_header rt-Fastcgi-Cache $upstream_cache_status;
  31. # Limit Request
  32. limit_req_status 403;
  33. limit_req_zone $remote_addr_ipscrub zone=one:10m rate=1r/s;
  34. ##
  35. # Simple DOS mitigation
  36. ##
  37. # Max c/s by ip
  38. #limit_conn_zone $binary_remote_addr zone=limit_per_ip:10m;
  39. #limit_conn limit_per_ip 80;
  40. # Max rq/s by ip
  41. #limit_req_zone $binary_remote_addr zone=allips:10m rate=400r/s;
  42. #limit_req zone=allips burst=400 nodelay;
  43. # Proxy Settings
  44. # set_real_ip_from proxy-server-ip;
  45. # real_ip_header X-Forwarded-For;
  46. fastcgi_read_timeout 120s;
  47. client_max_body_size 100m;
  48. # See - https://www.nginx.com/blog/thread-pools-boost-performance-9x/
  49. aio threads;
  50. # tls dynamic records patch directive
  51. ssl_dyn_rec_enable on;
  52. ssl_dyn_rec_size_hi 4229;
  53. ssl_dyn_rec_size_lo 1369;
  54. ssl_dyn_rec_threshold 40;
  55. ssl_dyn_rec_timeout 1000;
  56. # nginx-vts-status module
  57. vhost_traffic_status_zone;
  58. # oscp settings
  59. resolver 8.8.8.8 1.1.1.1 valid=300s;
  60. resolver_timeout 10;
  61. ##
  62. # GeoIP module configuration, before removing comments
  63. # read the tutorial : https://gist.github.com/VirtuBox/9ed03c9bd9169202c358a8be181b7840
  64. ##
  65. #geoip_country /usr/share/GeoIP/GeoIP.dat;
  66. #geoip_city /usr/share/GeoIP/GeoIPCity.dat;
  67. ##
  68. # SSL Settings
  69. ##
  70. # SSL Early Data
  71. ssl_early_data off;
  72. ssl_protocols TLSv1.2 TLSv1.3;
  73. ssl_ciphers 'TLS13+AESGCM+AES128:TLS13+AESGCM+AES256:TLS13+CHACHA20:EECDH+AESGCM:EECDH+CHACHA20';
  74. ssl_prefer_server_ciphers on;
  75. ssl_session_cache shared:SSL:50m;
  76. ssl_session_timeout 1d;
  77. ssl_session_tickets off;
  78. ssl_ecdh_curve X25519:sect571r1:secp521r1:secp384r1;
  79. # Common security headers
  80. more_set_headers "X-Frame-Options : SAMEORIGIN";
  81. more_set_headers "X-Xss-Protection : 1; mode=block";
  82. more_set_headers "X-Content-Type-Options : nosniff";
  83. more_set_headers "Referrer-Policy : strict-origin-when-cross-origin";
  84. more_set_headers "X-Download-Options : noopen";
  85. ##
  86. # Basic Settings
  87. ##
  88. # server_names_hash_bucket_size 64;
  89. # server_name_in_redirect off;
  90. include /etc/nginx/mime.types;
  91. default_type application/octet-stream;
  92. ##
  93. # Logging Settings
  94. ##
  95. # disable access_log for performance
  96. access_log off;
  97. error_log /var/log/nginx/error.log;
  98. # Log format Settings - user IP hashed with the module ipscrub
  99. log_format rt_cache '$remote_addr_ipscrub $upstream_response_time $upstream_cache_status [$time_local] '
  100. '$http_host "$request" $status $body_bytes_sent '
  101. '"$http_referer" "$http_user_agent" $server_protocol';
  102. # ipscrub settings
  103. ipscrub_period_seconds 3600;
  104. ##
  105. # Gzip Settings
  106. ##
  107. # mitigation of CRIME/BREACH attacks
  108. gzip off;
  109. ##
  110. # Brotli Settings
  111. ##
  112. brotli on;
  113. brotli_static on;
  114. brotli_buffers 16 8k;
  115. brotli_comp_level 4;
  116. brotli_types *;
  117. ##
  118. # Virtual Host Configs
  119. ##
  120. include /etc/nginx/conf.d/*.conf;
  121. include /etc/nginx/sites-enabled/*;
  122. }
  123. #mail {
  124. # # See sample authentication script at:
  125. # # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
  126. #
  127. # # auth_http localhost/auth.php;
  128. # # pop3_capabilities "TOP" "USER";
  129. # # imap_capabilities "IMAP4rev1" "UIDPLUS";
  130. #
  131. # server {
  132. # listen localhost:110;
  133. # protocol pop3;
  134. # proxy on;
  135. # }
  136. #
  137. # server {
  138. # listen localhost:143;
  139. # protocol imap;
  140. # proxy on;
  141. # }
  142. #}