Last active
September 17, 2020 13:45
-
-
Save baybatu/cdda39eb9dcd51814375a475e848724f to your computer and use it in GitHub Desktop.
Netscaler CORS configuration policy for multiple domains with their subdomains
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
add policy patset CORS_origins_allowed | |
bind policy patset CORS_origins_allowed .validdomain1.com -index 1 | |
bind policy patset CORS_origins_allowed .validdomain2.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"))` CORS_deny_response |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment