Forum Discussion
meenny_60187
Nimbostratus
Mar 29, 2016iRule load balance based on HTTP header username
I'm trying to modify an existing iRule below by creating a logic where it will parse the username being used, and load balance based on the username, while still using the HTTP::uri command. I know ...
Yann_Desmarest
Cirrus
Mar 29, 2016when HTTP_REQUEST {
if { [HTTP::uri] equals "/" } {
HTTP::uri /login/
pool default
} elseif { [HTTP::uri] equals "/" and [HTTP::username] contains "username1" or [HTTP::username] contains "username2" or [HTTP::username] contains "username3" } {
HTTP::uri /3dspace/ pool pool1
}
}
Yann_Desmarest
Cirrus
Mar 29, 2016If I understand correctly, your authentication process is a web login page. The HTTP::username command get the username from the Basic Authorization header so this irule can't work for you.
You have to parse the POST body of the login url to get the username. You can use the command HTTP::payload and HTTP::collect to retrieve the username.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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