ssl.conf.sample 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. server
  2. {
  3. listen 443 ssl http2;
  4. #listen [::]:443 ssl;
  5. server_name xxx.com;
  6. index luci index.html index.htm index.php default.html default.htm default.php;
  7. root /www;
  8. ssl_certificate '/etc/nginx/conf.d/_lan.crt';
  9. ssl_certificate_key '/etc/nginx/conf.d/_lan.key';
  10. ssl_session_timeout '64m';
  11. ssl_protocols TLSv1.2 TLSv1.3;
  12. ssl_prefer_server_ciphers on;
  13. ssl_ciphers "TLS13-AES-256-GCM-SHA384:TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-128-GCM-SHA256:TLS13-AES-128-CCM-8-SHA256:TLS13-AES-128-CCM-SHA256:EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5";
  14. ssl_session_cache 'shared:SSL:10m';
  15. #include rewrite/other.conf;
  16. #error_page 404 /404.html;
  17. location = /(robots.txt|favicon.ico) {
  18. log_not_found off;
  19. }
  20. location ~* \.(?:css(\.map)?|js(\.map)?|jpe?g|png|gif|ico|cur|heic|webp|tiff?|mp3|m4a|aac|ogg|midi?|wav|mp4|mov|webm|mpe?g|avi|ogv|flv|wmv)$ {
  21. expires 30d;
  22. }
  23. location ~* \.(?:svgz?|ttf|ttc|otf|eot|woff2?)$ {
  24. add_header Access-Control-Allow-Origin "*";
  25. expires 7d;
  26. }
  27. location ~ /\.(?!well-known) {
  28. deny all;
  29. }
  30. include conf.d/*.locations;
  31. }
  32. server {
  33. listen 80;
  34. server_name xxx.com www.xxx.com;
  35. return 301 https://$host$request_uri;
  36. }