
Nginx解决跨域问题No ‘Access
浏览器控制台报错
Access to XMLHttpRequest at ‘www.aaa’ from Origin ‘www.bbb’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.
解决办法使用Nginx在server块下或location块下为请求添加请求头都可以解决跨域问题。
add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Methods' 'GET,POST,DELETE'; add_header 'Access-Control-Allow-Header' 'Content-Type,*';👁️ 阅读量:0
© 版权声明:本文《Nginx解决跨域问题No ‘Access》内容均为本站精心整理或网友自愿分享,如需转载请注明原文出处:https://www.zastudy.cn/wen/1686960140a409135.html。