见到No ‘Access-Control-Allow-Origin’ header 字样,如下图所示:
在 A 地址的 nginx 添加如下字段
add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range'; add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range'; |
客户代理服务器需要能够将全部资源(包括静态资源转成 https)
nginx 部署 https 解决方法:location 中加入 proxy_redirect http:// $scheme://;
proxy_hide_header X-Frame-Options; add_header X-Frame-Options AllowAll; |