54 lines
1.3 KiB
Plaintext
54 lines
1.3 KiB
Plaintext
# runxian.top 裸域名 — 静态公共资源(微信域名校验等)
|
|
# HTTP: 保留 MP_verify + ACME;其余跳转 HTTPS
|
|
# HTTPS: deploy/enable-runxian-apex-ssl.sh 申请证书后启用
|
|
|
|
server {
|
|
listen 80;
|
|
server_name runxian.top;
|
|
|
|
access_log /var/log/nginx/dukang/runxian-apex.access.log main;
|
|
error_log /var/log/nginx/dukang/runxian-apex.error.log warn;
|
|
|
|
root /opt/dukang-haoke/public;
|
|
index index.html;
|
|
|
|
location ^~ /.well-known/acme-challenge/ {
|
|
root /var/www/certbot;
|
|
default_type "text/plain";
|
|
}
|
|
|
|
location ~ ^/MP_verify_.*\.txt$ {
|
|
default_type text/plain;
|
|
access_log off;
|
|
}
|
|
|
|
location / {
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl;
|
|
server_name runxian.top;
|
|
|
|
access_log /var/log/nginx/dukang/runxian-apex.access.log main;
|
|
error_log /var/log/nginx/dukang/runxian-apex.error.log warn;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/runxian.top/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/runxian.top/privkey.pem;
|
|
ssl_protocols TLSv1.2 TLSv1.3;
|
|
ssl_prefer_server_ciphers on;
|
|
|
|
root /opt/dukang-haoke/public;
|
|
index index.html;
|
|
|
|
location ~ ^/MP_verify_.*\.txt$ {
|
|
default_type text/plain;
|
|
access_log off;
|
|
}
|
|
|
|
location / {
|
|
try_files $uri $uri/ =404;
|
|
}
|
|
}
|