当前位置: 移动技术网 > IT编程>网页制作>CSS > vue-cli项目打包后代理接口报404错误解决办法

vue-cli项目打包后代理接口报404错误解决办法

2018年12月09日  | 移动技术网IT编程  | 我要评论

河北曲周,张新起,伤城之恋下载

vue-cli 项目打包后 代理接口报404错误 解决办法!

1、启动nginx

cd usr/local/nginx/sbin

./nginx

2、找到nginx安装目录

whereis nginx

cdusr/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 https://xxx.xx.xx.xxx:xxxx; // 接口地址
        }    

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网