Forum Discussion
f5 reverse proxy to remove ports in URI
Client traffic comes on port :XXXXX already or is it HTTP(s) on standard port with the /vXX uri ?
Do you backend server require the GET request to have the port specified?
If you have only one virtual server, I'd configure two pools - one for port 42828 and one for port 9445 - and use a simple iRule (something like the following) to route traffic accordingly
when HTTP_REQUEST {
if {[string tolower [HTTP::host]] ne "testws02.usneeded.com"}{ return }
switch -regex [HTTP::uri] {
^\/v9\/ { pool p_testws02_9445 }
^\/v10\/ { pool p_testws02_42828 }
default { pool p_testws02_http }
}
}
What pool is the default pool then? Do you mean have 3 pools?
- CA_ValliApr 20, 2023MVP
You should specify a default staetment that matches connections that don't meet previous criteria,
action can be anything you want - you can load balance it or you can drop it if that's the best option for you.
- ccmooreApr 20, 2023Nimbostratus
Thanks for clarifying.
when HTTP_REQUEST { if {[string tolower [HTTP::host]] ne "testws02.usneeded.com"}{ return } switch -regex [HTTP::uri] {
Can you help me to understand whats happening on the switch -regex line? Im asking because I'm getting 401's and wondering if the issue is there. It seems that there may be some header information not being forwarded of some sort.
Im getting this error:
traceId "43e5abc0-1e8d-41bd-b369-49bfab8de3c7" code 401 description "Authorization failure. Authorization information was invalid or missing from your request." message "Unauthorized" \
Recent Discussions
Related Content
* 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