ruoyi 前后分离部署502
我使用了nginx部署前端,使用docker部署。nginx文件如下:
server {listen 8086; #设置端口listen [::]:8086; #设置端口server_name localhost;#access_log /var/log/nginx/host.access.log main;location / {root /home/ruoyi/projects/ruoyi-ui;try_files $uri $uri/ /index.html;index index.html index.htm;}location /prod-api/{proxy_set_header Host $http_host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header REMOTE-HOST $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_pass http://localhost:8080/; #设置监控后端启动的端口}}
左看右看自己没写错,一直报502错误
最后排查发现是自己后端代理那里不能写localhost,换上实实在在的ip吧