跨域问题及其解决方案整理(随时更新)
标签搜索

跨域问题及其解决方案整理(随时更新)

170419
2021-11-11 / 1 评论 / 36 阅读 / 正在检测是否收录...
跨域问题及其解决方案整理(随时更新)
修改Nginx配置

在网站配置文件内添加如下内容:

server
{
    listen       80;
    index index.html index.htm index.php;
    root  /www/public/;

    add_header Access-Control-Allow-Origin *;
    add_header Access-Control-Allow-Headers "x-requested-with,Authorization,Accept, Origin, X-Requested-With, Content-Type, Last-Modified";
    add_header Access-Control-Allow-Methods GET,POST;
    add_header Access-Control-Max-Age 1728000;

   
}

To be continued...

0

评论 (1)

取消
  1. 头像
    李黄金
    Windows 10 · Google Chrome

    画图

    回复