server
{
listen 80 ;
server_name api.xxx.com;
index index.html index.php;
root /www/admin/public;
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
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';
location / {
if ($request_method = 'OPTIONS') { return 204; }
}
include enable-php.conf;
}