42 lines
1.2 KiB
Plaintext
42 lines
1.2 KiB
Plaintext
|
|
# 1. 强制 HTTP 转 HTTPS(统一跳转到 www.flytothemoon.net)
|
|||
|
|
server {
|
|||
|
|
listen 80;
|
|||
|
|
server_name flytothemoon.net www.flytothemoon.net;
|
|||
|
|
return 301 https://www.flytothemoon.net$request_uri;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
# 2. 统一将 flytothemoon.net 重定向到 www.flytothemoon.net(HTTPS 保留)
|
|||
|
|
server {
|
|||
|
|
listen 443 ssl;
|
|||
|
|
server_name flytothemoon.net;
|
|||
|
|
|
|||
|
|
ssl_certificate /data/tengine/conf/certificate/flytothemoon.net_bundle.crt;
|
|||
|
|
ssl_certificate_key /data/tengine/conf/certificate/flytothemoon.net.key;
|
|||
|
|
ssl_protocols TLSv1.2 TLSv1.3;
|
|||
|
|
ssl_ciphers HIGH:!aNULL:!MD5;
|
|||
|
|
|
|||
|
|
return 301 https://www.flytothemoon.net$request_uri;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
# 3. 正式服务站点(https://www.flytothemoon.net)
|
|||
|
|
server {
|
|||
|
|
listen 443 ssl;
|
|||
|
|
server_name www.flytothemoon.net;
|
|||
|
|
|
|||
|
|
ssl_certificate /data/tengine/conf/certificate/flytothemoon.net_bundle.crt;
|
|||
|
|
ssl_certificate_key /data/tengine/conf/certificate/flytothemoon.net.key;
|
|||
|
|
ssl_protocols TLSv1.2 TLSv1.3;
|
|||
|
|
ssl_ciphers HIGH:!aNULL:!MD5;
|
|||
|
|
|
|||
|
|
location / {
|
|||
|
|
root /data/tengine/html/www.flytothemoon.net/html/;
|
|||
|
|
index index.html index.htm;
|
|||
|
|
try_files $uri $uri/ /index.html;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
error_page 500 502 503 504 /50x.html;
|
|||
|
|
location = /50x.html {
|
|||
|
|
root html;
|
|||
|
|
}
|
|||
|
|
}
|