27 lines
874 B
Plaintext
27 lines
874 B
Plaintext
server {
|
||
listen 80;
|
||
server_name models.wantsong.life; # 域名
|
||
rewrite ^/(.*) https://$server_name$request_uri? permanent; # 将HTTP请求重定向到HTTPS
|
||
}
|
||
|
||
server {
|
||
listen 443 ssl;
|
||
server_name models.wantsong.life; # 同上,确保与上面的server_name一致
|
||
|
||
charset utf-8;
|
||
ssl_certificate /etc/nginx/ssl/_.wantsong.life.pem;
|
||
ssl_certificate_key /etc/nginx/ssl/_.wantsong.life.key;
|
||
|
||
ssl_session_timeout 5m;
|
||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
|
||
ssl_prefer_server_ciphers on;
|
||
ssl_session_cache shared:SSL:1m;
|
||
ssl_ciphers AWSGCM:ALL:!DH:!EXPORT:!RC4:+HIGH:!MEDIUM:!LOW:!aNULL:!eNULL;
|
||
|
||
root /data/models-wantsong-life; # 指向您的网站根目录
|
||
index index.html index.htm; # 指定默认索引文件
|
||
|
||
location / {
|
||
try_files $uri $uri/ =404; # 如果找不到文件则返回404
|
||
}
|
||
} |