进入site-enabled
文件夹,编辑其中的.conf
文件
<Directory /var/www>
Header set Access-Control-Allow-Origin "*"
</Directory>
我已经收到您在博客园你传递的正能量
但是我这样写行吗
<VirtualHost _default_:443> ServerAdmin webmaster@localhost ServerName -------------- DocumentRoot -------------- <Directory "/var/www/abc/public"> Header set Access-Control-Allow-Origin "*" Options Indexes FollowSymLinks AllowOverride All Require all granted Order allow,deny Allow from all </Directory>
还是报错
Image from origin 'https://mp.weixin.qq.com' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://www.pfmfinance.com' is therefore not allowed access.
@_zxd: 这是微信https://mp.weixin.qq.com
不允许你跨域访问,与你的apache配置无关