Forum Discussion

bradley2100's avatar
bradley2100
Icon for Nimbostratus rankNimbostratus
Jun 30, 2016

Simple Rewrite

Afternoon

 

I am in the process of setting up a simple rewrite migrating from TMG operating in Reverse proxy/load balance roles.

 

I simply want the F5 to rewrite and load balance an address along the lines of this

 

public.co.uk > f5 virtual server vip > load balance to nodes (each node is listening for specific header which differs from the external. i.e. internalpublic.co.uk)

 

I believe I have achieved the desired functionality with a rewrite profile that is '\' and rewrite to http:\internalpublic.co.uk\ (or at least this works as expected).

 

But is this the correct and best way to achieve this?

 

1 Reply

  • Rewrite profile can be utilized to achieve what you are seeking. If it works, you are on the right path. If you are seeking an alternate option using iRule, consider something similar to this:

    when HTTP_REQUEST {
    if { [HTTP::host] contains "abcd.com" } {
    HTTP::host [string map {abcd.com xyz.com} [HTTP::host]] 
    }
    
    when HTTP_RESPONSE {
    if { [HTTP::header values Location] contains "xyz.com" } {
    HTTP::header replace Location [string map {xyz.com abcd.com} [HTTP::header value Location]]
    }
    }