Created
October 30, 2020 14:59
-
-
Save czwen/140646f8dc4845bfb659911d471b8018 to your computer and use it in GitHub Desktop.
nginx cors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
add_header add always if need.