Forum Discussion

Bixo's avatar
Bixo
Icon for Nimbostratus rankNimbostratus
Oct 29, 2019

x-forwarded-host

Need to check every call to VIP and set x-forwarded-host to what the call was and then redirect it to another fqdn

example: http://aaaa.bbb.se/ccc

set x-forwarded-host till aaaa.bbb.se

then redirect it to https://dddd.eee.se/ccc

 

Is it possible? should i use Policy or iRule?

Any example?

3 Replies

  • Hi,

     

    Always use a built-in feature instead of iRule if available.

     

    You may try to do something like below with a policy.

     

  • Hi Bixo,

    iRule:

    when HTTP_REQUEST {
    	if { [HTTP::host] equals "aaaa.bbb.se"} {
    		HTTP::header insert "x-forwarded-host" [HTTP::host]
    		HTTP::redirect "https://dddd.eee.se[HTTP::uri]"
    	}
    }
  • Bixo's avatar
    Bixo
    Icon for Nimbostratus rankNimbostratus

    Thank you for the answers. Will try and see if it works.

     

    Br

    //Bixo