Skip to content

Instantly share code, notes, and snippets.

@lirongfei123
Created August 21, 2019 09:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lirongfei123/576ce866f3e4f31d7f1a3d6bd4b34b8b to your computer and use it in GitHub Desktop.
Save lirongfei123/576ce866f3e4f31d7f1a3d6bd4b34b8b to your computer and use it in GitHub Desktop.
location / {
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';
if ($request_method = 'OPTIONS') {
return 204;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment