在server中配置
add_header Access-Control-Allow-Origin *;

add_header Access-Control-Allow-Headers X-Requested-With;

add_header Access-Control-Allow-Methods GET,POST,OPTIONS;
Apache支持跨域
    ServerName www.statics.xxx.io

    DocumentRoot E:/project/xxx/statics

    Header set Access-Control-Allow-Origin *

    Header set Access-Control-Allow-Methods "GET, POST, OPTIONS"

    Header set Access-Control-Allow-Headers "Content-Type"

    Options +Indexes +Includes +FollowSymLinks +MultiViews

    AllowOverride All

    Require local

原文来自:http://www.hhailuo.com/archives/18405

本文地址:https://www.linuxprobe.com/server-static-file.html编辑:吴向平,审核员:逄增宝