@dazhicheng/common 1.0.18 → 1.0.20
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/.gitlab-ci.yml +4 -2
- package/nginx_dev.conf +34 -26
- package/nginx_test.conf +34 -26
- package/package.json +1 -1
package/.gitlab-ci.yml
CHANGED
|
@@ -12,10 +12,12 @@ variables:
|
|
|
12
12
|
image: node:24-alpine
|
|
13
13
|
tags:
|
|
14
14
|
- build
|
|
15
|
+
resource_group: build
|
|
15
16
|
script:
|
|
16
|
-
- npm install -g pnpm
|
|
17
|
-
- pnpm
|
|
17
|
+
- npm install -g pnpm@latest
|
|
18
|
+
- pnpm config set registry https://registry.npmmirror.com
|
|
18
19
|
- pnpm install --no-frozen-lockfile
|
|
20
|
+
- pnpm up:dzc
|
|
19
21
|
- pnpm "build:${NODE_ENV}"
|
|
20
22
|
artifacts:
|
|
21
23
|
paths:
|
package/nginx_dev.conf
CHANGED
|
@@ -1,26 +1,34 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
# 根据请求Host分配后端地址(公网Host走公网,默认走内网)
|
|
2
|
+
map $http_host $dev_backend_addr {
|
|
3
|
+
default 192.168.128.215:11000; # 默认走内网
|
|
4
|
+
120.76.61.203:13000 14.220.235.21:11000; # 公网Host走公网
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
# HTTP 服务器 - 保持原有配置
|
|
8
|
+
server {
|
|
9
|
+
<<<listen>>>
|
|
10
|
+
server_name localhost;
|
|
11
|
+
charset utf-8;
|
|
12
|
+
|
|
13
|
+
root /usr/share/nginx/html;
|
|
14
|
+
index index.html;
|
|
15
|
+
|
|
16
|
+
location / {
|
|
17
|
+
try_files $uri $uri/ /index.html;
|
|
18
|
+
<<<CORS配置>>>
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
location /dev-api/ {
|
|
22
|
+
proxy_set_header Host $host;
|
|
23
|
+
proxy_set_header X-Real-Ip $remote_addr;
|
|
24
|
+
proxy_set_header X-Forwarded-For $remote_addr;
|
|
25
|
+
|
|
26
|
+
rewrite ^/dev-api/(.*) /$1 break;
|
|
27
|
+
proxy_pass http://$dev_backend_addr/;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
error_page 500 502 503 504 /50x.html;
|
|
31
|
+
location = /50x.html {
|
|
32
|
+
root html;
|
|
33
|
+
}
|
|
34
|
+
}
|
package/nginx_test.conf
CHANGED
|
@@ -1,26 +1,34 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
# 根据请求Host分配后端地址(公网Host走公网,默认走内网)
|
|
2
|
+
map $http_host $test_backend_addr {
|
|
3
|
+
default 192.168.127.72:11000; # 默认走内网
|
|
4
|
+
120.76.61.203:13000 116.6.49.180:11001; # 公网Host走公网
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
# HTTP 服务器 - 保持原有配置
|
|
8
|
+
server {
|
|
9
|
+
<<<listen>>>
|
|
10
|
+
server_name localhost;
|
|
11
|
+
charset utf-8;
|
|
12
|
+
|
|
13
|
+
root /usr/share/nginx/html;
|
|
14
|
+
index index.html;
|
|
15
|
+
|
|
16
|
+
location / {
|
|
17
|
+
try_files $uri $uri/ /index.html;
|
|
18
|
+
<<<CORS配置>>>
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
location /test-api/ {
|
|
22
|
+
proxy_set_header Host $host;
|
|
23
|
+
proxy_set_header X-Real-Ip $remote_addr;
|
|
24
|
+
proxy_set_header X-Forwarded-For $remote_addr;
|
|
25
|
+
|
|
26
|
+
rewrite ^/test-api/(.*) /$1 break;
|
|
27
|
+
proxy_pass http://$test_backend_addr;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
error_page 500 502 503 504 /50x.html;
|
|
31
|
+
location = /50x.html {
|
|
32
|
+
root html;
|
|
33
|
+
}
|
|
34
|
+
}
|