首页 > 编程知识 正文

vue前端代理解决跨域,不使用nginx怎么部署vue

时间:2023-05-06 05:06:51 阅读:131313 作者:3339

add _ header ' access-control-allow-origin ' * '; add _ header ' access-control-allow-headers ' ' content-type,access-control-allow-headers,Authorization,x 服务器_ name * * * * * *; location~*.*" (gif|jpg|JPEG|BMP|swf|IOC|ico|rar|zip|flv|mid|pdf|) proxy_cache_valid any 10s; proxy _ cache _ key $ host $ uri $ is _ args $ args; add _ headerx-cache ' $ upstream _ cache _ status from $ host '; proxy _ pass http://127.0.0.1:2200; expires 1d; } location/{ proxy _ pass http://127.0.0.1:2200; proxy_set_header Host $host; proxy _ set _ headerx-real-IP $ remote _ addr; proxy _ set _ headerx-forwarded-for $ proxy _ add _ x _ forwarded _ for; proxy _ set _ header upgrade $ http _ upgrade; proxy _ set _ header connection ' upgrade '; } location/API/{ proxy _ pass http://127.0.0.133602200/} error _ page 500502503504/50x.html; location=/50x.html { root/usr/share/nginx/html; }服务器{ listen 80; 服务器_ name * * * * * *; add _ header ' access-control-allow-origin ' * '; add _ header ' access-control-allow-headers ' ' content-type,access-control-allow-headers,Authorization,x } location/API/{ proxy _ pass http://127.0.0.133602200/} error _ page 500502503504/50x.html; location=/50x.html { root/usr/share/nginx/html; }

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。