eb961c3a74
Serve user/shop/partner H5 under /user/, /shop/, /partner/ on a single authorized domain; update nginx, SSL script, and router base paths. Co-authored-by: Cursor <cursoragent@cursor.com>
135 lines
3.7 KiB
Plaintext
135 lines
3.7 KiB
Plaintext
# 杜康好客 — runxian.top(HTTP)
|
||
# 三端 H5 统一入口 m.runxian.top/{user,shop,partner}/(微信网页授权单域名)
|
||
# 旧子域名 user/shop/partner 301 到统一入口;webadmin → 8094;dkapi → 8090
|
||
|
||
# --- 统一 H5 入口(证书就绪前 HTTP;HTTPS 见 dukang-runxian-ssl.conf)---
|
||
server {
|
||
listen 80;
|
||
server_name m.runxian.top;
|
||
|
||
access_log /var/log/nginx/dukang/runxian-m.access.log main;
|
||
error_log /var/log/nginx/dukang/runxian-m.error.log warn;
|
||
|
||
client_max_body_size 20m;
|
||
|
||
location ^~ /.well-known/acme-challenge/ {
|
||
root /var/www/certbot;
|
||
default_type "text/plain";
|
||
}
|
||
|
||
location ~ ^/MP_verify_.*\.txt$ {
|
||
root /opt/dukang-haoke/apps/h5-user/dist;
|
||
default_type text/plain;
|
||
access_log off;
|
||
}
|
||
|
||
location /api/ {
|
||
proxy_pass http://127.0.0.1:8090;
|
||
proxy_http_version 1.1;
|
||
proxy_set_header Host $host;
|
||
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;
|
||
proxy_set_header Connection "";
|
||
}
|
||
|
||
location = / {
|
||
return 302 /user/;
|
||
}
|
||
|
||
location /user/ {
|
||
alias /opt/dukang-haoke/apps/h5-user/dist/;
|
||
try_files $uri $uri/ index.html;
|
||
}
|
||
|
||
location /shop/ {
|
||
alias /opt/dukang-haoke/apps/h5-shop/dist/;
|
||
try_files $uri $uri/ index.html;
|
||
}
|
||
|
||
location /partner/ {
|
||
alias /opt/dukang-haoke/apps/h5-partner/dist/;
|
||
try_files $uri $uri/ index.html;
|
||
}
|
||
}
|
||
|
||
# --- 旧 H5 子域名 → 统一入口(保留书签/推广链接)---
|
||
server {
|
||
listen 80;
|
||
server_name user.runxian.top;
|
||
return 301 http://m.runxian.top/user$request_uri;
|
||
}
|
||
|
||
server {
|
||
listen 80;
|
||
server_name shop.runxian.top;
|
||
return 301 http://m.runxian.top/shop$request_uri;
|
||
}
|
||
|
||
server {
|
||
listen 80;
|
||
server_name partner.runxian.top;
|
||
return 301 http://m.runxian.top/partner$request_uri;
|
||
}
|
||
|
||
# --- HTTP: API ---
|
||
server {
|
||
listen 80;
|
||
server_name dkapi.runxian.top;
|
||
|
||
access_log /var/log/nginx/dukang/runxian-api.access.log main;
|
||
error_log /var/log/nginx/dukang/runxian-api.error.log warn;
|
||
|
||
client_max_body_size 20m;
|
||
|
||
location ^~ /.well-known/acme-challenge/ {
|
||
root /var/www/certbot;
|
||
default_type "text/plain";
|
||
}
|
||
|
||
location / {
|
||
proxy_pass http://127.0.0.1:8090;
|
||
proxy_http_version 1.1;
|
||
proxy_set_header Host $host;
|
||
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;
|
||
proxy_set_header Connection "";
|
||
}
|
||
}
|
||
|
||
# --- HTTP: admin-web ---
|
||
server {
|
||
listen 80;
|
||
server_name webadmin.runxian.top;
|
||
|
||
access_log /var/log/nginx/dukang/runxian-admin.access.log main;
|
||
error_log /var/log/nginx/dukang/runxian-admin.error.log warn;
|
||
|
||
client_max_body_size 20m;
|
||
|
||
location ^~ /.well-known/acme-challenge/ {
|
||
root /var/www/certbot;
|
||
default_type "text/plain";
|
||
}
|
||
|
||
location /api/ {
|
||
proxy_pass http://127.0.0.1:8090;
|
||
proxy_http_version 1.1;
|
||
proxy_set_header Host $host;
|
||
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;
|
||
proxy_set_header Connection "";
|
||
}
|
||
|
||
location / {
|
||
proxy_pass http://127.0.0.1:8094;
|
||
proxy_http_version 1.1;
|
||
proxy_set_header Host $host;
|
||
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;
|
||
}
|
||
}
|