@dazhicheng/common 1.0.48 → 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.
- package/.env.development +1 -1
- package/nginx_dev.conf +20 -9
- package/package.json +1 -1
- package/src/types/index.d.ts +2 -0
package/.env.development
CHANGED
|
@@ -10,7 +10,7 @@ VITE_MOCK_ENABLED = true
|
|
|
10
10
|
# 代理目标地址(开发环境通过 Vite 代理转发请求到此地址,解决跨域问题)
|
|
11
11
|
|
|
12
12
|
# 域名
|
|
13
|
-
VITE_API_PROXY_URL_dev =
|
|
13
|
+
VITE_API_PROXY_URL_dev = https://dev.fulfillment.tiantai-jp.com/
|
|
14
14
|
VITE_API_PROXY_URL_test = http://fulfillment-test.tiantai-jp.com:11000/
|
|
15
15
|
|
|
16
16
|
|
package/nginx_dev.conf
CHANGED
|
@@ -5,13 +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
|
-
# 根据请求
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
default fulfillment-dev.tiantai-jp.com:11000; #
|
|
12
|
-
|
|
13
|
-
#
|
|
14
|
-
|
|
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;
|
|
15
20
|
}
|
|
16
21
|
|
|
17
22
|
# HTTP 服务器 - 保持原有配置
|
|
@@ -65,17 +70,23 @@ server {
|
|
|
65
70
|
}
|
|
66
71
|
|
|
67
72
|
location /dev-api/ {
|
|
68
|
-
|
|
73
|
+
# 对齐 Vite changeOrigin:Host 用上游域名,勿用前端 $host(否则 Ingress 404)
|
|
74
|
+
proxy_set_header Host $dev_backend_host;
|
|
69
75
|
proxy_set_header X-Real-Ip $remote_addr;
|
|
70
76
|
proxy_set_header X-Forwarded-For $remote_addr;
|
|
71
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
|
+
|
|
72
83
|
# 与前端 TtHttp REQUEST_TIMEOUT 对齐:10 分钟
|
|
73
84
|
proxy_connect_timeout 600s;
|
|
74
85
|
proxy_send_timeout 600s;
|
|
75
86
|
proxy_read_timeout 600s;
|
|
76
87
|
|
|
77
88
|
rewrite ^/dev-api/(.*) /$1 break;
|
|
78
|
-
proxy_pass
|
|
89
|
+
proxy_pass $dev_backend_url;
|
|
79
90
|
}
|
|
80
91
|
|
|
81
92
|
error_page 500 502 503 504 /50x.html;
|
package/package.json
CHANGED