43 lines
1.1 KiB
Plaintext
43 lines
1.1 KiB
Plaintext
# jd.van333.cn 独立静态站 + API 反代到 jarvis 旧服
|
|
# 将 root 改为实际部署目录
|
|
|
|
server {
|
|
listen 80;
|
|
server_name jd.van333.cn;
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
server_name jd.van333.cn;
|
|
|
|
root /www/sites/jd.van333.cn/index;
|
|
index index.html;
|
|
|
|
ssl_certificate /opt/1panel/apps/openresty/openresty/www/common/ssl/jd.van333.cn/fullchain.cer;
|
|
ssl_certificate_key /opt/1panel/apps/openresty/openresty/www/common/ssl/jd.van333.cn.key;
|
|
|
|
# 仅反代查询接口到旧服
|
|
location ^~ /jarvis-api/open/jd/ {
|
|
proxy_pass https://jarvis.van333.cn/jarvis-api/open/jd/;
|
|
proxy_ssl_server_name on;
|
|
proxy_set_header Host jarvis.van333.cn;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
}
|
|
|
|
# 兼容旧链接 /open/jd/promoter
|
|
location = /open/jd/promoter {
|
|
try_files /index.html =404;
|
|
}
|
|
|
|
location = / {
|
|
try_files /index.html =404;
|
|
}
|
|
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
}
|