Http://www.nginx.cn/nginx-download
nginx.conf Configuration
if ($request _method = ' OPTIONS ') {
Add_header Access-control-allow-origin *;
Add_header access-control-allow-credentials true;
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 ';
return 200;
}
if ($request _method = ' POST ') {
Add_header ' Access-control-allow-origin ' *;
Add_header ' access-control-allow-credentials ' true ';
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 ';
}
if ($request _method = ' GET ') {
Add_header ' Access-control-allow-origin ' *;
Add_header ' access-control-allow-credentials ' true ';
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 ';
}
Nginx cross-domain processing