Apache解决Access-Control-Allow-Origin多域名跨域问题

开发人员反馈:

No ‘Access-Control-Allow-Origin’ header is present on the requested resource


vi httpd.conf 取消如下注释#


LoadModule headers_module [...]


然后VirtualHost服务中添加
Header set Access-Control-Allow-Origin "*"

##全局配置如下

vi httpd.conf 最下面添加如下配置:

    Header set Access-Control-Allow-Origin: "*"

    Header set Access-Control-Allow-Methods: "GET,POST,PUT,DELETE,OPTIONS"

    Header set Access-Control-Allow-Headers: "Content-Type"


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/30327022/viewspace-2650808/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/30327022/viewspace-2650808/

你可能感兴趣的:(Apache解决Access-Control-Allow-Origin多域名跨域问题)