Skip to content

Commit c606480

Browse files
authored
doc: update docs/nginx.md (#985)
1 parent 1e0da19 commit c606480

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

docs/nginx.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -295,19 +295,25 @@ server {
295295
server {
296296
listen 443 ssl http2;
297297
server_name example.com;
298-
ssl on;
299298
300299
ssl_certificate /path/to/cert.pem;
301300
ssl_certificate_key /path/to/privkey.pem;
301+
302+
# 优化 SSL 配置
303+
ssl_protocols TLSv1.2 TLSv1.3; # 禁用旧版 TLS
304+
ssl_prefer_server_ciphers on;
305+
ssl_ciphers 'ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256';
306+
ssl_session_timeout 1d;
307+
ssl_session_cache shared:SSL:10m;
302308
303-
ssl_stapling on;
304-
ssl_stapling_verify on;
305-
ssl_trusted_certificate /path/to/fullchain.pem;
309+
# 其他配置(如根目录、代理等)
310+
root /var/www/html;
311+
index index.html;
306312
307-
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
308-
ssl_session_timeout 1d;
309-
ssl_session_cache shared:SSL:50m;
310-
add_header Strict-Transport-Security max-age=15768000;
313+
location / {
314+
try_files $uri $uri/ =404;
315+
}
316+
311317
}
312318
```
313319

0 commit comments

Comments
 (0)