vue 调用nginx服务跨越的问题
server {
listen 80;
server_name api.xxxx.com;
add_header Access-Control-Allow-Origin '*' ;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
location / {
proxy_pass http://127.0.0.1:9001;
proxy_connect_timeout 1600;
proxy_read_timeout 6000;
}
location = /50x.html {
root html;
}
}
记得重新重启nginx, 有些nginx 会缓存配置,有点坑得很,我搞了很多都不行,最后关机,一天之后 nginx 自己把缓存给清