选择允许跨域的网站,选择设置,注意不要直接去修改Nginx配置。无效
在这里插入图片描述
增加允许跨域访问配置。
在这里插入图片描述

 add_header Access-Control-Allow-Origin *;
 add_header Access-Control-Allow-Headers Origin,Accept,Authorization,platformId,ut,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type;
 add_header Access-Control-Allow-Methods GET,POST,OPTIONS;
 add_header Access-Control-Allow-Credentials true;

保存后关闭网站重启nginx

Logo

一起探索未来云端世界的核心,云原生技术专区带您领略创新、高效和可扩展的云计算解决方案,引领您在数字化时代的成功之路。

更多推荐