目前默认调试地址是localhost:1818,本地已经做了解析域名,把127.0.0.1解析到了api.xxxx.com。现在要实现本地就用api.xxxx.com:1818调试,如何解决呢
nignx 代理 将域名指向127.0.0.1:1818
只做返代测试不行,在本地配合端口转发才可以 netsh interface portproxy add v4tov4 listenport=1818 listenaddress=localhost connectport=1818 connectaddress=系统IP netsh interface portproxy add v4tov4 listenport=1818 listenaddress=0.0.0.0 connectport=1818 connectaddress=系统IP netsh interface portproxy add v4tov4 listenport=8000 listenaddress=0.0.0.0 connectport=8000 connectaddress=系统IP netsh interface portproxy show all
修改.env 文件的VITE_AXIOS_BASE_URL
nignx 代理 将域名指向127.0.0.1:1818
只做返代测试不行,在本地配合端口转发才可以
netsh interface portproxy add v4tov4 listenport=1818 listenaddress=localhost connectport=1818 connectaddress=系统IP
netsh interface portproxy add v4tov4 listenport=1818 listenaddress=0.0.0.0 connectport=1818 connectaddress=系统IP
netsh interface portproxy add v4tov4 listenport=8000 listenaddress=0.0.0.0 connectport=8000 connectaddress=系统IP
netsh interface portproxy show all
修改.env 文件的VITE_AXIOS_BASE_URL
- 1
前往