Wednesday, August 5, 2020

F5 - irule to rewrite "Location" header from server

Hi all,

I'm not even sure if this is possible but here we go.

I am trying to get an F5 BIG IP to rewrite a http response "Location" header. Client requests are having their host headers rewritten, and I'm trying to rewrite the location header that the server sends back.

If I use Chrome or Firefox dev tools I can see the server sending the Location header back. I'm able to statically rewrite this in an irule using HTTP::header replace Location "https://blar.com"

My issue is this, the location header the server send backs will obviously vary, sometimes its https://blar.com/blar, other times its https://blar.com/doubleblar

The crux of the issue is I'm struggling to expose this info to the F5. I have tried logging all request and response headers but I don't see the "location" header in the logs, yet I see it when inspecting it in Chrome on the client.

My idea was to get the location header, extra the URI part and then rewrite it dynamically.

Any assistance much appreciated.



No comments:

Post a Comment