Skip to content

Instantly share code, notes, and snippets.

@gorillamoe
Created November 14, 2020 09:40
Show Gist options
  • Save gorillamoe/8e33759445efe93ee66826dfa50446bc to your computer and use it in GitHub Desktop.
Save gorillamoe/8e33759445efe93ee66826dfa50446bc to your computer and use it in GitHub Desktop.
nginx CORS config - check if origin is set
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