Skip to content

Instantly share code, notes, and snippets.

@kkroesch
Forked from Ry4an/cors-nginx.conf
Last active August 29, 2015 14:16
Show Gist options
  • Save kkroesch/39ef6427dc76b39adb9c to your computer and use it in GitHub Desktop.
Save kkroesch/39ef6427dc76b39adb9c 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