- docker-compose.yml 重写为单栈 4 容器(admin 边缘 + v2-api/v2-admin/v2-postgres), v2 数据卷 deploy-v2_pgdata/uploads 以 external 引用,数据零迁移 - nginx:/uploads/ /assets/ 上游改 v2-api(product-center 覆盖块随之冗余移除), / 跳转 /v2/admin/;docker-compose.v2.yml 删除(血统已并入 develop) - v1 api+postgres 已停用未删,终档/快照/回滚手册见 deploy/backups/consolidation-*/ - 切换验证:v2 库切换前后行数完全一致;/v2-api /public /v2/admin /v2/h5 /assets 全路由冒烟 + 公网端到端通过
106 lines
2.9 KiB
Plaintext
106 lines
2.9 KiB
Plaintext
server {
|
||
listen 80;
|
||
server_name official.inkreach.cc;
|
||
|
||
client_max_body_size 10m;
|
||
|
||
# ACME challenge for cert renewals
|
||
location /.well-known/acme-challenge/ {
|
||
root /var/www/certbot;
|
||
}
|
||
|
||
location / {
|
||
return 301 https://$host$request_uri;
|
||
}
|
||
}
|
||
|
||
server {
|
||
listen 443 ssl;
|
||
http2 on;
|
||
server_name official.inkreach.cc;
|
||
|
||
ssl_certificate /etc/nginx/certs/official.inkreach.cc_ecc/fullchain.cer;
|
||
ssl_certificate_key /etc/nginx/certs/official.inkreach.cc_ecc/official.inkreach.cc.key;
|
||
ssl_protocols TLSv1.2 TLSv1.3;
|
||
|
||
client_max_body_size 10m;
|
||
|
||
root /usr/share/nginx/html;
|
||
|
||
location /.well-known/acme-challenge/ {
|
||
root /var/www/certbot;
|
||
}
|
||
|
||
# Admin SPA
|
||
location /admin/ {
|
||
try_files $uri $uri/ /admin/index.html;
|
||
}
|
||
location = /admin {
|
||
return 301 /admin/;
|
||
}
|
||
|
||
# v2(refactor/v2 分支)路径分流:SPA 原样透传给 v2 admin 容器,/v2-api 去掉前缀转发到 v2 api
|
||
location /v2/admin/ {
|
||
proxy_pass http://v2-admin:80;
|
||
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;
|
||
}
|
||
|
||
# v2 版 H5:透传给 v2 admin 容器(文件在 v2 镜像内,路径 /v2/h5/)
|
||
location /v2/h5/ {
|
||
proxy_pass http://v2-admin:80;
|
||
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;
|
||
}
|
||
|
||
location /v2-api/ {
|
||
proxy_pass http://v2-api:3001/;
|
||
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;
|
||
}
|
||
|
||
# H5 历史构建的 API 基址是同源相对路径 /public/*(BASE_URL="/"),直通 v2 api(路径原样透传)
|
||
location /public/ {
|
||
proxy_pass http://v2-api:3001;
|
||
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;
|
||
}
|
||
|
||
location = /h5 {
|
||
return 301 /h5/;
|
||
}
|
||
|
||
location /h5/{
|
||
try_files $uri $uri/ /h5/index.html;
|
||
}
|
||
|
||
# Uploaded files served by the API
|
||
location /uploads/ {
|
||
proxy_pass http://v2-api:3001/uploads/;
|
||
proxy_set_header Host $host;
|
||
}
|
||
|
||
# Static product assets served by the API
|
||
location /assets/ {
|
||
proxy_pass http://v2-api:3001/assets/;
|
||
proxy_set_header Host $host;
|
||
}
|
||
|
||
# Website placeholder until the public site is deployed
|
||
location / {
|
||
return 302 /v2/admin/;
|
||
}
|
||
}
|