为了账号安全,请及时绑定邮箱和手机立即绑定

小白,请教各位大佬!关于vue项目在生产环境中nginx的配置问题求大佬指点!

小白,请教各位大佬!关于vue项目在生产环境中nginx的配置问题求大佬指点!

温温酱 2019-08-21 13:28:00
我在前端设置了反向代理代码如下proxyTable:{'/API':{target:'http://dev.snhb.group:9090',//target:'192.168.31.110:9090',changeOrigin:true,secure:false,pathRewrite:{'^/API':'/'}}},这是请求:exportfunctionlistLineSelect(){returnrequest({url:'/API/pcms/pcms/alarm/listAllLine',method:'post',baseURL:'',params:{}})}开发环境是没有问题的但是在生产环境遇到了这样的问题RequestURL:http://localhost:9090/API/pcms/security/sso/ajaxcheck?account=gmservice&password=123546RequestMethod:POSTStatusCode:404RemoteAddress:127.0.0.1:9090ReferrerPolicy:no-referrer-when-downgrade我想变成这样的请求http://localhost:9090/pcms/security/sso/ajaxcheck?所以我尝试在nginx进行了如下配置server{listen9090;server_namelocalhost;#charsetkoi8-r;#access_loglogs/host.access.logmain;location~*/api/{proxy_passhttp://dev.snhb.group:9090;roothtml;indexindex.htmlindex.htm;}并没得用。不知道大家有没有好办法呢。。谢谢了
查看完整描述

2 回答

  • 2 回答
  • 0 关注
  • 529 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号