nginx.conf 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. http {
  2. include log.conf;
  3. server {
  4. listen 8080;
  5. include cert/cert.conf;
  6. include api.conf;
  7. include www.conf;
  8. }
  9. include acme.conf;
  10. # https://nginx.org/en/docs/http/ngx_http_core_module.html
  11. resolver 1.1.1.1 ipv6=off;
  12. resolver_timeout 10s;
  13. keepalive_timeout 60;
  14. keepalive_requests 2048;
  15. server_tokens off;
  16. underscores_in_headers on;
  17. # https://nginx.org/en/docs/http/ngx_http_ssl_module.html
  18. ssl_protocols TLSv1.2 TLSv1.3;
  19. ssl_ciphers TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-256-GCM-SHA384:TLS13-AES-128-GCM-SHA256:EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH;
  20. ssl_session_cache shared:SSL:30m;
  21. ssl_session_timeout 1d;
  22. ssl_prefer_server_ciphers on;
  23. # https://nginx.org/en/docs/http/ngx_http_limit_req_module.html
  24. limit_req_log_level warn;
  25. limit_req_zone $binary_remote_addr zone=reqip:16m rate=100r/s;
  26. limit_req zone=reqip burst=200 nodelay;
  27. access_log logs/proxy.log log_proxy buffer=64k flush=1s;
  28. # https://nginx.org/cn/docs/http/ngx_http_proxy_module.html
  29. # 1MB = 8000key
  30. proxy_cache_path cache
  31. levels=1:2
  32. keys_zone=my_cache:32m
  33. max_size=20g
  34. inactive=6h
  35. use_temp_path=off
  36. ;
  37. proxy_http_version 1.1;
  38. proxy_ssl_server_name on;
  39. proxy_buffer_size 16k;
  40. proxy_buffers 4 32k;
  41. proxy_busy_buffers_size 64k;
  42. proxy_send_timeout 10s;
  43. lua_load_resty_core off;
  44. map $http_origin $_origin_id {
  45. include allowed-sites.conf;
  46. }
  47. }
  48. # https://nginx.org/en/docs/ngx_core_module.html
  49. events {
  50. worker_connections 4096;
  51. }