Created
November 14, 2020 09:40
-
-
Save gorillamoe/8e33759445efe93ee66826dfa50446bc to your computer and use it in GitHub Desktop.
nginx CORS config - check if origin is set
This file contains 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
if ($args !~ origin) { | |
add_header 'access-control-allow-origin' '*'; | |
} | |
if ($args ~ origin) { | |
add_header 'access-control-allow-origin' $http_origin; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment