Skip to content

Instantly share code, notes, and snippets.

@bmurtagh
Forked from Ry4an/cors-nginx.conf
Last active August 29, 2015 14:20
Show Gist options
  • Save bmurtagh/f4d4d90b5782102a05fc to your computer and use it in GitHub Desktop.
Save bmurtagh/f4d4d90b5782102a05fc to your computer and use it in GitHub Desktop.
#
# Minimal CORS config for nginx
#
# A modification of https://gist.github.com/alexjs/4165271
#
# NB: This relies on the use of the 'Origin' HTTP Header.
location /static {
if ($http_origin ~* (whitelist\.address\.one|whitelist\.address\.two)$) {
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