-
-
Save Ry4an/6195025 to your computer and use it in GitHub Desktop.
Here' the minimal Access-Control-Allow-Origin header insertion necessary to allow any whitelisted sites to access resources via CORS headers.
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
# | |
# 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