Reason: CORS header 'Access-Control-Allow-Origin' does not match 'xyz' - HTTP 编辑
Reason
Reason: CORS header 'Access-Control-Allow-Origin' does not match 'xyz'
What went wrong?
In other words, the origin making the request does not match any of the origins permitted by the Access-Control-Allow-Origin
header.
This error can also occur if the response includes more than one Access-Control-Allow-Origin
header.
If the service your code is accessing using a CORS request is under your control, make sure that it's configured to include your origin in its Access-Control-Allow-Origin
header, and that only one such header is included in responses. The header itself accepts a comma-delineated list of origins, so adding a new origin is not difficult.
For example, in Apache, add a line such as the following to the server's configuration (within the appropriate <Directory>
, <Location>
, <Files>
, or <VirtualHost>
section). The configuration is typically found in a .conf
file (httpd.conf
and apache.conf
are common names for these), or in an .htaccess
file.
Header set Access-Control-Allow-Origin 'origin-list'
For Nginx, the command to set up this header is:
add_header 'Access-Control-Allow-Origin' 'origin-list'
See also
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论