我在前端設(shè)置了反向代理代碼如下proxyTable:{'/API':{target:'http://dev.snhb.group:9090',//target:'192.168.31.110:9090',changeOrigin:true,secure:false,pathRewrite:{'^/API':'/'}}},這是請(qǐng)求:exportfunctionlistLineSelect(){returnrequest({url:'/API/pcms/pcms/alarm/listAllLine',method:'post',baseURL:'',params:{}})}開(kāi)發(fā)環(huán)境是沒(méi)有問(wèn)題的但是在生產(chǎn)環(huán)境遇到了這樣的問(wèn)題RequestURL:http://localhost:9090/API/pcms/security/sso/ajaxcheck?account=gmservice&password=123546RequestMethod:POSTStatusCode:404RemoteAddress:127.0.0.1:9090ReferrerPolicy:no-referrer-when-downgrade我想變成這樣的請(qǐng)求http://localhost:9090/pcms/security/sso/ajaxcheck?所以我嘗試在nginx進(jìn)行了如下配置server{listen9090;server_namelocalhost;#charsetkoi8-r;#access_loglogs/host.access.logmain;location~*/api/{proxy_passhttp://dev.snhb.group:9090;roothtml;indexindex.htmlindex.htm;}并沒(méi)得用。不知道大家有沒(méi)有好辦法呢。。謝謝了
小白,請(qǐng)教各位大佬!關(guān)于vue項(xiàng)目在生產(chǎn)環(huán)境中nginx的配置問(wèn)題求大佬指點(diǎn)!
溫溫醬
2019-08-21 13:28:00