Forum Discussion
JoergK
Nimbostratus
Mar 11, 2019How to make a branch decsision based on HTTP header in an Access Policy?
Hello everyone,
I have to make a branch decision in an Access Policy based on the value in the HTTP header field 'host'. For example, if [HTTP::host] matches foo.example.com a given branch (lik...
stan_piron
Cumulonimbus
Mar 12, 2019Hi,
HTTP Host header is already provisioned in a Access variable:
session.server.network.nameYou van use this branch expression:
expr { [mcget {session.server.network.name}] == "foo.example.com" }if you want to collect another HTTP header, don't use iRule Event but this irule code:
when ACCESS_SESSION_STARTED {
ACCESS::session data set session.custom.myHeader [HTTP::header myHeader]
}This ACCESS_SESSION_STARTED raise just before Access session redirect to /my.policy
This event is the best time to catch first request content (HTTP headers, URI, query string, HTTP Method, ...)
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