Appears during commissioning of the front desk
XMLHttpRequest cannot load http://www.xx.com/Action/Index.php?Action=11. No ' Access-control-allow-origin ' header is present on the requested resource. Origin ' http://blog.xx.com ' is therefore not allowed access.
This time only needs to be added in the HTTP response header
Access-control-allow-origin:http://blog.xx.com
Attention:
Generic domain names, such as *.xx.com, are not supported
Can only be configured as *, or specify a URI
When configuring the specified domain name, you need to add http://https://prefix;
Or is
Access-control-allow-origin:http://www.xx.com,http://blog.xx.com
Otherwise it's
Access-control-allow-origin: *
Nginx Add Method:
Add_header Access-control-allow-origin *;
Haproxy Add Method:
Rspadd access-control-allow-origin:\ *
This article is from "Maple Night" blog, please be sure to keep this source http://fengwan.blog.51cto.com/508652/1892964
JS Request cross-domain problem--access-control-allow-origin