常见问题解决 --- 若依vue部署前后端 502 (Bad Gateway)
nginx配置文件中配置代理访问
这里配置的proxy_pass是后台接口的代理
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/; # 这里的8080是后台端口
}
浙公网安备 33010602011771号