Forum Discussion
Patricio_quirog
Oct 25, 2022Altocumulus
Apache origin and header conversion to iRules
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$" Acces...
JRahm
Admin
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
}
}
Patricio_quirog
Nov 03, 2022Altocumulus
thanks and for sure put into a test enviroment first.
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects