码迷,mamicode.com
首页 > Web开发 > 详细

apache设置跨域请求

时间:2019-07-10 18:17:47      阅读:137      评论:0      收藏:0      [点我收藏+]

标签:apach   virtual   from   virt   strong   http   lin   headers   class   

<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设置跨域请求

标签:apach   virtual   from   virt   strong   http   lin   headers   class   

原文地址:https://www.cnblogs.com/zhangzhijian/p/11165252.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!