Forum Discussion
Manipulating host: XXX.XXX.XXX in http POST header
I need to change the host:xxx.xxx.xxx field to the endpoint on a http request. I have been attempting to look at the wiki for syntax but I am forced to use IE6 which crashes every time I access IRules wiki. Also I am new at this.
Basiclly we are sending soap envelopes to vip on the F5 (9.4.3). The http post does get sent to the pool member or endpoint. The endpoint responds with a 302 redirect to the endpoint ip. I suspect this is due to Apache ReWriteRules and the host:xxx.xxx.xxx field has the virtual ip of the F5 and needs to be the IP of the member (or destination of the member of the pool). This is a third party solution so we can't jack with that end, and don't want a redirect since the 302 indicates the destination intended in the 1st place.
So we have a vip with pool with 2 endpoints- I would like to modify host field to reflect the active pool member of the http request. I am in a lab enviroment so this would only be a test. I think this would be similar to IRule redirect samples, I have looked at but I would like to change the host field to the active pool member to avoid the redirect. Maybe there is a better method of doing this.
POST /who/what/ProvisioningServic HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: ""
User-Agent: Jakarta Commons-HttpClient/3.1
Host: x.x.x.x <----- reflects F5 vip ip - needs to change to active member in pool
Content-Length: 780
I hope I explained this correctly and thanks for any responses.
- Michael_Yates
Nimbostratus
If I am understanding what you need correctly this should get you started.when HTTP_RESPONSE { if { [HTTP::is_redirect] and [HTTP::header Location] contains "bad.ip.address" } { HTTP::header replace Location [string map -nocase {bad.ip.address good.ip.address.or.url} [HTTP::header value Location]] } }
- John_45559
Nimbostratus
Actually the redirect has the correct IP. Let's say I am posting to 1.1.1.1/here/there which in this case 1.1.1.1 ip is the vip ip on the F5. When the post is sent to (endpoint) 2.2.2.2/here/there. the 302 found response indicates the document has moved to 2.2.2.2/here/there. In the post the HOST field retains the VIP IP which I think is causing the redirect.
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