apache设置跨域请求
Posted zhangzhijian
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了apache设置跨域请求相关的知识,希望对你有一定的参考价值。
<VirtualHost *:80> DocumentRoot /data/www/test ServerName test.com Header set Access-Control-Allow-Origin * Header set Access-Control-Allow-Credentials true Header set Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept" <Directory /> Options FollowSymLinks ExecCGI Indexes AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost>
在 httpd-vhosts.conf 添加
Header set Access-Control-Allow-Origin *
Header set Access-Control-Allow-Credentials true
Header set Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept"
以上是关于apache设置跨域请求的主要内容,如果未能解决你的问题,请参考以下文章