首页 新闻 会员 周边

请问ubuntu apache 怎么设置access-control-allow-origin *

0
[已解决问题] 解决于 2018-05-03 16:44

这是我的配置文件
但配置文件不一样

但配置文件不一样但配置文件不一样但配置文件不一样但配置文件不一样但配置文件不一样

 

 

 

_zxd的主页 _zxd | 初学一级 | 园豆:145
提问于:2018-03-12 13:27
< >
分享
最佳答案
0

进入site-enabled文件夹,编辑其中的.conf文件

<Directory /var/www>
      Header set Access-Control-Allow-Origin "*"
</Directory>
奖励园豆:5
dudu | 高人七级 |园豆:31003 | 2018-03-12 13:35
我已经收到您在博客园你传递的正能量
但是我这样写行吗
<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 | 园豆:145 (初学一级) | 2018-03-12 13:44

@_zxd: 这是微信https://mp.weixin.qq.com不允许你跨域访问,与你的apache配置无关

dudu | 园豆:31003 (高人七级) | 2018-03-12 13:54
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册