Skip to content

Instantly share code, notes, and snippets.

@phodal
Created August 1, 2017 01:08
Show Gist options
  • Save phodal/76eff91df344e7e3f4d1896331364465 to your computer and use it in GitHub Desktop.
Save phodal/76eff91df344e7e3f4d1896331364465 to your computer and use it in GitHub Desktop.
location /api {
proxy_pass http://localhost:12306.cn
add_header 'Access-Control-Allow-Origin' '*' always;
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, PATCH, OPTIONS, HEAD';
add_header 'Access-Control-Allow-Headers' 'Authorization, X-Requested-With, Content-Type';
return 204;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment