Forum Discussion
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] }
- BinaryCanary_19Historic F5 Account
You might want to take a look at URL Rewriting
- DeeTay_233210
Nimbostratus
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_19Historic F5 Accountsome 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.
- DeeTay_233210
Nimbostratus
I have seen the URL rewriting and it is quite straight forward. Thanks
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com