美文网首页工作生活
Apache 跨域配置

Apache 跨域配置

作者: 方松潭 | 来源:发表于2019-07-03 11:16 被阅读0次

在配置文件中Apache24/conf/httpd.conf中搜索:
LoadModule headers_module modules/mod_headers.so
去除前面的#号

<VirtualHost *:8000>
    DocumentRoot C:
        WSGIScriptAlias / C:\users\bruce_fang\desktop\outside_api\conf.wsgi
    WSGIScriptReloading On
    WSGIPassAuthorization On
    LogLevel info
        <Directory C:\users\bruce_fang\desktop\outside_api>
        AllowOverride AuthConfig FileInfo
        Order deny,allow
                Allow from all
        Require all granted
        Header set Access-Control-Allow-Origin * #添加这段配置,*号可以使用具体域名代替
        </Directory>
</VirtualHost>

相关文章

网友评论

    本文标题:Apache 跨域配置

    本文链接:https://www.haomeiwen.com/subject/jsqqhctx.html