zongyuewang 2019-08-28
可以在server模块加上如下代码
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept, If-Modified-Since";
add_header Access-Control-Allow-Methods "GET, POST, OPTIONS";
if ($request_method = 'OPTIONS') {
return 204;
}