Skip to content

Instantly share code, notes, and snippets.

@ipmb
Last active August 6, 2019 17:05
Show Gist options
  • Save ipmb/f4a09441d4320708c905bf7a7f8db272 to your computer and use it in GitHub Desktop.
Save ipmb/f4a09441d4320708c905bf7a7f8db272 to your computer and use it in GitHub Desktop.
Add CORS headers for domains matching a regex in uWSGI
# Add CORS header for Origin's which match a regexp
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin#Examples
route-if = regexp:${HTTP_ORIGIN};^.*\.example\.com$ addheader:Access-Control-Allow-Origin: ${HTTP_ORIGIN}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment