近期vue小项目,本地测试运行正常,但是部署到线上服务器时,出现跨域问题。需要nginx服务器服务器中设置增加配置参数如下。
location /api {
add_header 'Access-Control-Allow-Origin' '*';
proxy_pass http://xxx.xx.xxx.xxx:8080;
}
如遇其他问题,欢迎沟通交流。
近期vue小项目,本地测试运行正常,但是部署到线上服务器时,出现跨域问题。需要nginx服务器服务器中设置增加配置参数如下。
location /api {
add_header 'Access-Control-Allow-Origin' '*';
proxy_pass http://xxx.xx.xxx.xxx:8080;
}
如遇其他问题,欢迎沟通交流。