@dazhicheng/common 1.0.49 → 1.0.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/nginx_dev.conf +20 -10
  2. package/package.json +1 -1
package/nginx_dev.conf CHANGED
@@ -5,14 +5,18 @@ log_format proxy_log
5
5
  'upstream_status=$upstream_status upstream_time=${upstream_response_time}s | '
6
6
  'referer="$http_referer" agent="$http_user_agent"';
7
7
 
8
- # 根据请求IP分配后端地址(公网IP走公网,默认走内网)
9
- map $host $dev_backend_addr {
10
- # fulfillment-dev.tiantai-jp.com -> 192.168.128.215
11
- # default fulfillment-dev.tiantai-jp.com:11000; # 默认走内网
12
- default dev.fulfillment.tiantai-jp.com; # 默认走内网
13
- # ly-dev.tiantai-jp.com -> 14.127.204.225
14
- #
15
- 120.76.61.203 ly-dev.tiantai-jp.com:11000; # 公网IP走公网
8
+ # 根据请求 Host 分配完整上游 URL(对齐 Vite:https + changeOrigin)
9
+ # Vite: target=https://dev.fulfillment.tiantai-jp.com/ changeOrigin=true secure=false
10
+ map $host $dev_backend_url {
11
+ # default http://fulfillment-dev.tiantai-jp.com:11000; # 旧内网网关
12
+ default https://dev.fulfillment.tiantai-jp.com;
13
+ 120.76.61.203 http://ly-dev.tiantai-jp.com:11000; # 公网IP走公网
14
+ }
15
+
16
+ # Host / SNI 用纯主机名,不能带 https://
17
+ map $host $dev_backend_host {
18
+ default dev.fulfillment.tiantai-jp.com;
19
+ 120.76.61.203 ly-dev.tiantai-jp.com:11000;
16
20
  }
17
21
 
18
22
  # HTTP 服务器 - 保持原有配置
@@ -66,17 +70,23 @@ server {
66
70
  }
67
71
 
68
72
  location /dev-api/ {
69
- proxy_set_header Host $host;
73
+ # 对齐 Vite changeOrigin:Host 用上游域名,勿用前端 $host(否则 Ingress 404)
74
+ proxy_set_header Host $dev_backend_host;
70
75
  proxy_set_header X-Real-Ip $remote_addr;
71
76
  proxy_set_header X-Forwarded-For $remote_addr;
72
77
 
78
+ # 对齐 Vite secure:false(Ingress 假证书时仍可回源)
79
+ proxy_ssl_server_name on;
80
+ proxy_ssl_name $dev_backend_host;
81
+ proxy_ssl_verify off;
82
+
73
83
  # 与前端 TtHttp REQUEST_TIMEOUT 对齐:10 分钟
74
84
  proxy_connect_timeout 600s;
75
85
  proxy_send_timeout 600s;
76
86
  proxy_read_timeout 600s;
77
87
 
78
88
  rewrite ^/dev-api/(.*) /$1 break;
79
- proxy_pass http://$dev_backend_addr;
89
+ proxy_pass $dev_backend_url;
80
90
  }
81
91
 
82
92
  error_page 500 502 503 504 /50x.html;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dazhicheng/common",
3
- "version": "1.0.49",
3
+ "version": "1.0.50",
4
4
  "description": "共享配置文件",
5
5
  "type": "module",
6
6
  "types": "./src/types/index.d.ts",