以下是在Debian下提升Nginx SSL性能的關鍵措施:
更新軟件與證書
sudo apt update && sudo apt install nginx certbot python3-certbot-nginx
。優化SSL/TLS配置
ECDHE-ECDSA-AES128-GCM-SHA256
)。ssl_session_cache shared:SSL:10m
)并設置超時時間(如10分鐘),減少握手開銷。啟用高效協議與壓縮
gzip on; gzip_comp_level 6
)。調整Nginx性能參數
worker_processes auto
(按CPU核心數自動調整),增加worker_connections
(如1024)以提升并發能力。其他優化
ssl_session_tickets off
)。expires
指令)減少磁盤I/O。修改配置后需重啟Nginx:sudo systemctl restart nginx
,并使用nginx -t
測試配置語法。