本帖最后由 cnnewin 于 2020-3-8 18:26 编辑
站点设置301重定向之后报错。CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
服务器是nginx,网上查需要加上这段代码
- location / {
- add_header Access-Control-Allow-Origin *;
- add_header Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept";
- add_header Access-Control-Allow-Methods "GET, POST, OPTIONS";
- }
复制代码 我在站点修改配置,添加不上去提示错误,好像不让加“/”
请大神指教一下怎么配置才生效。谢谢
|
|