vue-cli 项目打包后 代理接口报404错误 解决办法!,vue-cli404
vue-cli 项目打包后 代理接口报404错误 解决办法!,vue-cli404
1、启动nginx
cd usr/local/nginx/sbin
./nginx
2、找到nginx安装目录
whereis nginx
cd usr/local/nginx/
3、打开nginx 配置文件
cd conf/
vi nginx.conf 按i 修改,新增配置
location /api {
proxy_set_header Host $host;
proxy_set_header x-forwarded-for $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://XXX.XX.XX.XXX:XXXX; // 接口地址
}
评论暂时关闭