参考:http://blog.csdn.net/emily201314/article/details/52877277

  步骤1 #打开apache的headers模块

sudo  a2enmod headers

  步骤2 #修改配置文件

<VirtualHost *:80>
        ServerName www.api.com
        DocumentRoot /xxx
        Header set Access-Control-Allow-Origin * #加上此配置
</VirtualHost>

  步骤3  #重启服务

sudo service apache2 restart

  测试跨域访问即可

 

相关文章:

  • 2022-01-20
  • 2022-12-23
  • 2022-12-23
  • 2021-09-08
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-06-21
  • 2022-12-23
  • 2021-12-28
  • 2021-07-13
  • 2021-09-25
  • 2021-04-10
相关资源
相似解决方案