Access to XMLHttpRequest at ‘http://mis.jiaxianghudong.com/mis/v1/public/login’ from origin ‘http://mis.weiletest.com’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: Redirect is not allowed for a preflight request.

mis.weiletest.com想访问mis.jiaxianghudong.com/mis/v1后端的接口造成的跨域问题
解决方法,在后端的反向代理nginx 的server配置加上即可
proxy_set_header X-CROS true;
前端跨域问题
最新推荐文章于 2025-05-03 22:26:12 发布
本文介绍了在前端项目中遇到的跨域问题,具体表现为mis.weiletest.com尝试访问mis.jiaxianghudong.com/mis/v1接口时被CORS策略阻止。为了解决这个问题,提出了在后端反向代理nginx服务器上配置`proxy_set_header X-CORS true;`的方法,允许跨域请求。这为前端与不同源后端接口的交互提供了解决方案。
1480

被折叠的 条评论
为什么被折叠?



