首先編輯httpd.conf(/etc/httpd/conf/httpd.conf)
把LoadModule headers_module modules/mod_headers.so 前面的註釋刪除,開啓apache頭信息自定義模塊
找到<Directory />添加一行:Header set Access-Control-Allow-Origin *
即:
<Directory />
AllowOverride none
Require all granted
Header set Access-Control-Allow-Origin *
</Directory>apache