发现JEECG反向代理开启后 重设了Host头,导致积木框架的数据接口url拼接异常
Nginx配置增加:
# 通过反向代理访问积木报表,Jeecg框架内的菜单配置需要写成绝对路径:http://localhost:3000/jeecg-boot/jmreport/list?token=${token} location ^~ /jeecg-boot/jmreport/ { # proxy_set_header Host $host; proxy_pass http://localhost:8081/jeecg-boot/jmreport/; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; }
修改配置文件:application-*.yml
#后台接口全路径地址(必填) VITE_GLOB_DOMAIN_URL= 填写自己的正确地址