Skip to content

Commit 1abc368

Browse files
ipcjsth-ci
authored andcommitted
fix: minio改成动态解析域名, 防止启动顺序导致的403错误
fix: minio改成动态解析域名 wip: video-minio中minio的域名也需要动态解析
1 parent 56fcc77 commit 1abc368

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

nginx/conf/conf.d/track.conf.template

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ server {
6060
}
6161

6262
location /minio/ {
63-
proxy_pass http://${MINIO_HOST}:${MINIO_PORT}/;
63+
# 动态解析minio的域名
64+
set $dynamic "${MINIO_HOST}";
65+
proxy_pass http://$dynamic:${MINIO_PORT}/;
6466
}
6567

6668
location /jtt808/ {

nginx/conf/conf.d/video-minio.conf.template

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ server {
1515

1616
# minio录像云存储
1717
location /minio/ {
18-
proxy_pass http://${MINIO_HOST}:${MINIO_PORT}/;
18+
# 动态解析minio的域名
19+
set $dynamic "${MINIO_HOST}";
20+
proxy_pass http://$dynamic:${MINIO_PORT}/;
1921
}
2022

2123
#access_log /var/log/nginx/host.access.log main;

nginx/conf/nginx.conf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,9 @@ http {
7575
~*(GPTBot|ChatGPT-User|ClaudeBot|PerplexityBot|CCBot) 1;
7676
}
7777

78-
# Docker Compose的默认DNS
78+
# Docker Compose的默认DNS, 动态解析proxy_pass的域名等情况下, 会用到
7979
# https://stackoverflow.com/questions/35744650/docker-network-nginx-resolver
80+
# https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass:~:text=server%20group.-,Parameter%20value%20can%20contain%20variables,-.%20In%20this%20case
8081
resolver 127.0.0.11;
8182
include /etc/nginx/conf.d/*.conf;
8283
}

0 commit comments

Comments
 (0)