25-Oct-2022
07:19
- last edited on
02-Nov-2022
15:31
by
JRahm
I need to take this an Irule f5 can you help me with this please
<IfModule mod_headers.c>
Header edit Set-Cookie ^(.*)$ $1;SameSite=None;Secure
SetEnvIf Origin "^http(s)?://(.+\.)?tgr\.cl$" AccessControlAllowOrigin=$0
Header set Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin
Header set Access-Control-Allow-Credentials "true"
</IfModule>
02-Nov-2022 15:29
Hi @Patricio_quirog, I'm no expert on apache configs...but I think this duplicates the logic. Test for sure before rolling anything to a production environment:
when HTTP_REQUEST {
set host [HTTP::host]
if { $host ends_with “tgr.cl” } {
set origin_match 1
} else { ## what to do if it does not match? }
}
when HTTP_RESPONSE {
if { [info exists origin_match] } {
HTTP::header remove Access-Control-Allow-Origin
HTTP::header remove Access-Control-Allow-Credentials
HTTP::header insert Access-Control-Allow-Origin $host
HTTP::header insert Access-Control-Allow-Credentials true
}
}
03-Nov-2022 06:08
thanks and for sure put into a test enviroment first.