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.

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