Skip to content

Instantly share code, notes, and snippets.

@keburak
Last active September 17, 2020 13:48
Show Gist options
  • Save keburak/b9b0fad40eb441dbdb7793f0c283e7bf to your computer and use it in GitHub Desktop.
Save keburak/b9b0fad40eb441dbdb7793f0c283e7bf to your computer and use it in GitHub Desktop.
netscaler-multiple-cors-pol
add policy patset CORS_origins_allowed
bind policy patset CORS_origins_allowed .domain.com -index 1
bind policy patset CORS_origins_allowed .domain.com -index 2
add responder action CORS_deny_response respondwith q{"HTTP/1.0 401 Unauthorized CORS\r\n\r\n"} -bypassSafetyCheck YES
add responder policy CORS_origin_denied "HTTP.REQ.HEADER(\"Origin\").EXISTS&&HTTP.REQ.HEADER(\"Origin\").TYPECAST_HTTP_URL_T.HOSTNAME.CONTAINS_ANY(\"CORS_origins_allowed\").NOT" CORS_deny_response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment