Forum Discussion

DeeTay_233210's avatar
DeeTay_233210
Icon for Nimbostratus rankNimbostratus
Nov 12, 2015

HTTP:Host modification

I wish to have clients connect to a server with one URL and get feedback on the same URL. However, the host element in the URL would have been modified between the LTM and the server. For example

 

Client ==> https://abcdef.lion.com:1234/$uri ==> LTM ==> https:/abc.lion.com:1234/$uri / ==> Server

 

Server ==> https://abc.lion.com:1234/$uri ==> LTM ==> https:/abcdef.lion.com:1234/$uri / ==> Client

 

In all this manipulation of the host element, the URI remains the same.

 

This action is required because the server application is programmed to respond to only requests that come with the host name abc.lion.com. However, I do not want the user to launch the URL https://abc.lion.com:1234/$uri as it would conflict with production.

 

The objective is to test the backup system without impacting production.

 

I have tried using irule but it does not fully achieve the objective. Find below sample irule used

 

when HTTP_REQUEST { if { not ([string tolower [getfield [HTTP::host] : 1]] contains "def") } { HTTP::redirect https://abc.lion.com:1234[HTTP::uri] } }

 

when HTTP_RESPONSE { HTTP::redirect https://abcdef.lion.com:1234[uri::path] }

 

4 Replies

    • DeeTay_233210's avatar
      DeeTay_233210
      Icon for Nimbostratus rankNimbostratus
      I used the URL Rewriting, however, the page displays if no additional uri are added. The moment the uri is added after the hostname and port numbers; there is a page cannot be displayed error message.
    • BinaryCanary_19's avatar
      BinaryCanary_19
      Historic F5 Account
      some data would be necessary to see what is happening. Pick one example rewrite rule that you added, and then let me see what it looks like, and if you can show what URL is seen on client side, and what is seen on server-side.