@dazhicheng/common 1.0.21 → 1.0.22

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/nginx_dev.conf CHANGED
@@ -1,14 +1,14 @@
1
1
  # 自定义日志格式:包含实际转发的后端地址
2
2
  log_format proxy_log
3
- '[$time_local] $status $request ============================== '
4
- 'client=$remote_addr upstream=$upstream_addr ============================== '
5
- 'upstream_status=$upstream_status upstream_time=${upstream_response_time}s ============================== '
3
+ '[$time_local] $status $request | '
4
+ 'client=$remote_addr upstream=$upstream_addr | '
5
+ 'upstream_status=$upstream_status upstream_time=${upstream_response_time}s | '
6
6
  'referer="$http_referer" agent="$http_user_agent"';
7
7
 
8
- # 根据请求Host分配后端地址(公网Host走公网,默认走内网)
9
- map $http_host $dev_backend_addr {
8
+ # 根据请求IP分配后端地址(公网IP走公网,默认走内网)
9
+ map $host $dev_backend_addr {
10
10
  default 192.168.128.215:11000; # 默认走内网
11
- 120.76.61.203:13000 14.220.235.21:11000; # 公网Host走公网
11
+ 120.76.61.203 14.220.235.21:11000; # 公网IP走公网
12
12
  }
13
13
 
14
14
  # HTTP 服务器 - 保持原有配置
@@ -34,7 +34,7 @@ server {
34
34
  proxy_set_header X-Forwarded-For $remote_addr;
35
35
 
36
36
  rewrite ^/dev-api/(.*) /$1 break;
37
- proxy_pass http://$dev_backend_addr/;
37
+ proxy_pass http://$dev_backend_addr;
38
38
  }
39
39
 
40
40
  error_page 500 502 503 504 /50x.html;
package/nginx_test.conf CHANGED
@@ -1,14 +1,14 @@
1
1
  # 自定义日志格式:包含实际转发的后端地址
2
2
  log_format proxy_log
3
- '[$time_local] $status $request ============================== '
4
- 'client=$remote_addr upstream=$upstream_addr ============================== '
5
- 'upstream_status=$upstream_status upstream_time=${upstream_response_time}s ============================== '
3
+ '[$time_local] $status $request | '
4
+ 'client=$remote_addr upstream=$upstream_addr | '
5
+ 'upstream_status=$upstream_status upstream_time=${upstream_response_time}s | '
6
6
  'referer="$http_referer" agent="$http_user_agent"';
7
7
 
8
- # 根据请求Host分配后端地址(公网Host走公网,默认走内网)
9
- map $http_host $test_backend_addr {
8
+ # 根据请求IP分配后端地址(公网IP走公网,默认走内网)
9
+ map $host $test_backend_addr {
10
10
  default 192.168.127.72:11000; # 默认走内网
11
- 120.76.61.203:13000 116.6.49.180:11001; # 公网Host走公网
11
+ 120.76.61.203 116.6.49.180:11001; # 公网IP走公网
12
12
  }
13
13
 
14
14
  # HTTP 服务器 - 保持原有配置
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dazhicheng/common",
3
- "version": "1.0.21",
3
+ "version": "1.0.22",
4
4
  "description": "共享配置文件",
5
5
  "type": "module",
6
6
  "types": "./src/types/index.d.ts",