Forum Discussion
Apache1048_5684
Nimbostratus
Sep 26, 2017Irule based on host name contains to redirect
I am working with Peppol and need an irule that will redirect based on a wildcard URL
The URL will end with ".publisher.edelivery.tech.ec.europa.eu" and the beginning could be any string. Ours
elcom-smp-test.publisher.edelivery.tech.ec.europa.eu
So far I have tried multiple combinations of ends_with and contains but no joy. We use
when HTTP_REQUEST {
switch [HTTP::host] {
smpdev.elcom.com { pool smpdev-pool }
smpqa.elcom.com { pool smpqa-pool }
smptest.elcom.com { pool smptest-pool }
elcom-smp-test.publisher.edelivery.tech.ec.europa.eu { pool smptest-pool }
default { reject }
}
}
but I need the last line to match the last portion (publisher.edelivery.tech.ec.europa.eu) of the host name - is that possible?
- Stanislas_Piro2
Cumulonimbus
Hi,
you can use glog option in switch command allowing wildcard:
when HTTP_REQUEST { switch -glob -- [HTTP::host] { "smpdev.elcom.com" { pool smpdev-pool } "smpqa.elcom.com" { pool smpqa-pool } "smptest.elcom.com" { pool smptest-pool } "*.publisher.edelivery.tech.ec.europa.eu" { pool smptest-pool } default { reject } } }
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