跨域请求 Apache 服务器配置的方法
时间: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 *
意思是对这个域名的资源进行访问时,添加一个头信息
最后重启服务器生效
上一篇:关于安装LNMP集成包后上传图片报500错误的解决方法
栏 目:Linux
本文标题:跨域请求 Apache 服务器配置的方法
本文地址:http://www.codeinn.net/misctech/119118.html






