mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2026-08-05 20:38:45 +00:00
fix(docker): 单体前端nginx改用docker内嵌DNS运行时解析后端地址
避免jeecg-boot-system容器重启换IP后nginx缓存旧IP导致502需手动重启, 用rewrite保留/jeecgboot/->/jeecg-boot/路径映射。 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
1cd59161a1
commit
24338e562c
@ -4,8 +4,12 @@ VOLUME /tmp
|
||||
ENV LANG en_US.UTF-8
|
||||
RUN echo "server { \
|
||||
listen 80; \
|
||||
#使用docker内嵌DNS运行时解析,避免后端容器重启换IP后nginx缓存旧IP导致502 \
|
||||
resolver 127.0.0.11 valid=10s ipv6=off; \
|
||||
location /jeecgboot/ { \
|
||||
proxy_pass http://jeecg-boot-system:8080/jeecg-boot/; \
|
||||
set \$jeecg_system jeecg-boot-system; \
|
||||
rewrite ^/jeecgboot/?(.*)\$ /jeecg-boot/\$1 break; \
|
||||
proxy_pass http://\$jeecg_system:8080; \
|
||||
proxy_redirect off; \
|
||||
proxy_set_header Host jeecg-boot-system; \
|
||||
proxy_set_header X-Real-IP \$remote_addr; \
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user