Forum Discussion

gbbaus_104974's avatar
gbbaus_104974
Historic F5 Account
Sep 19, 2011

How can I Change IP Address references to FQDN references

Hi Guys

 

 

I am trying to use the STREAM command to replace the IP Address of the Virtual Server, with a FQDN (and vice versa)

 

I have Enabled streams on the Virtual server, and well as enabled Chunking on the both Request and Response.

 

 

 

============================

 

Rewrite the headers and links when you have to used IP addresses

 

as apposed to FQDN names in referencing the Virtual server.

 

when HTTP_REQUEST {

 

Check if response type is text

 

if {[HTTP::header value Content-Type] contains "text"}{

 

Enable the stream filter for the life of the current TCP connection

 

STREAM::enable

 

STREAM::expression {@}

 

}

 

}

 

when HTTP_RESPONSE {

 

Check if response type is text

 

if {[HTTP::header value Content-Type] contains "text"}{

 

Enable the stream filter for the life of the current TCP connection

 

STREAM::enable

 

STREAM::expression @}

 

}

 

}

 

 

I have checked the tcpdump (to the pool member) and the Host, and Referer and Location headers dont seem to be changing

 

 

Any ideas

 

 

Thnaks

 

Gary

 

 

1 Reply

  • Hi Gary,

     

     

    When you add the stream profile to a virtual server with an HTTP profile, the rewriting only applies to the HTTP request and response payloads. You can selectively enable the stream profile from an iRule using STREAM::enable|disable. To rewrite HTTP request or response headers, you can use 'HTTP::header replace $header $new_value'.

     

     

    Make sure to enable the stream filter after you set the stream expression:

     

     

    STREAM::expression {@mysite.lab.com@172.16.20.34@}

     

    STREAM::enable

     

     

    For full feature HTTP proxying, check the ProxyPass iRule:

     

     

    http://devcentral.f5.com/wiki/iRules.proxypassv10.ashx

     

     

    Aaron