server
{
listen 80;
server_name www.aaa.com aaa.com;
rewrite ^(.*)$ https://${server_name}$1 permanent;
location / {
root /home/wwwroot/default/aaa;
index index.html index.htm;
}
}
server
{
listen 443 ssl;
server_name www.aaa.com aaa.com; #用户服务器的域名
#ssl on;
ssl_certificate /usr/local/nginx/cert/scs1622099240193_www.aaa.com_server.crt;
ssl_certificate_key /usr/local/nginx/cert/scs1622099240193_www.aaa.com_server.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
ssl_prefer_server_ciphers on;
location / {
root /home/wwwroot/default/aaa; #站点目录
index index.html index.htm;
}
access_log /home/wwwlogs/access.log;
}