本地应用
http://localhost:8010(192.168.51.67)
请求目标
http://192.168.51.233:4567
无法直接通过ajax实现请求,涉及到跨域;
解决方案
nginx.conf
server {
listen 8001;
server_name localhost;
location / {
add_header 'Access-Control-Allow-Origin' '*';
proxy_pass http://192.168.51.233:4567;
}
}
js文件中的请求地址
http://192.168.51.67:8001/