languageexpand_more
English Deutsch Español Français Русский язык Italiano 한어 简体中文 繁體中文 日本語

nginx配置ssl证书

server {
# 证书
listen 443 ssl ;
server_name <domain1> <domain2>;
ssl_certificate /etc/nginx/crt/<webname>.pem;
ssl_certificate_key /etc/nginx/crt/<webname>.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
ssl_prefer_server_ciphers on;

# HTTPS跳转
server {
listen 80 ;
server_name <domain1> <domain2>;
return 301 https://$server_name$request_uri;
}