refer: Nginx配置跨域请求 Access-Control-Allow-Origin *

    配置:

    1. location / {
    2. add_header Access-Control-Allow-Origin *;
    3. add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
    4. add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';
    5. if ($request_method = 'OPTIONS') {
    6. return 204;
    7. }
    8. }