我在前端设置了反向代理代码如下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;}并没得用。不知道大家有没有好办法呢。。谢谢了
相关分类