时间:2021-05-11 08:53:29 | 栏目:Linux | 点击:次
1.修改服务器配置文件
<Directory /www/web/yuming.com/public_html/> Options FollowSymLinks AllowOverride All Require all granted Header set Access-Control-Allow-Origin * </Directory>
2.编辑httpd.conf
找下面这行,把#去掉,目的是开启apache头信息自定义模块
#LoadModule headers_module modules/mod_headers.so
重点内容
Access-Control-Allow-Origin *
意思是对这个域名的资源进行访问时,添加一个头信息
最后重启服务器生效