# I will try here.. Modification http header

**URL:** <https://community.f5.com/t/i-will-try-here-modification-http-header/34042>\
**Category:** Technical Forums\
**Tags:** new-to-f5, basic, getting-started\
**Created:** [June 16, 2010, 3:02pm UTC](https://community.f5.com/t/i-will-try-here-modification-http-header/34042 "2010-06-16T15:02:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_45559](https://avatars.discourse-cdn.com/v4/letter/j/9e8a1a/32.png) [@John\_45559](https://community.f5.com/u/John_45559)\
**Post date:** [June 16, 2010, 3:02pm UTC](https://community.f5.com/t/i-will-try-here-modification-http-header/34042/1 "2010-06-16T15:02:06Z")

</div>

I need an IRule for an HTTP request.

I need to modify the HOST: xxx.xxx.xxx.xxx field in the header.

Example:

POST /webservice/services/ProvisioningService 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 \<----------- I want to replace this ip with a member IP in the pool (which is the active member.

Content-Length: 780

I would like to change the HOST: field from the IP (which is the vitrual server IP) to the IP of active member in the pool (there are 2 members). This rule would be on a HTTP\_REQUEST rule. I can’t access the wiki as it crashes my browser

I have tried posting in other topics but since I am a newb adding the situation apparently causing confusion of what I want since the response from the endpoint is a redirect and I don’t want a redirect.

Thanks

John

---

<div class="post-metadata">

**Author:** ![hoolio](https://avatars.discourse-cdn.com/v4/letter/h/f6c823/32.png) [@hoolio](https://community.f5.com/u/hoolio)\
**Post date:** [June 16, 2010, 3:15pm UTC](https://community.f5.com/t/i-will-try-here-modification-http-header/34042/2 "2010-06-16T15:15:21Z")

</div>

Hi John,

If you want to rewrite the HTTP host header value to the IP address of the selected server, you can use an iRule like this:

```tcl
when HTTP_REQUEST_SEND {

    Force evaluation in the clientside context
   clientside {

       Replace the Host header value with the selected server IP address
      HTTP::header replace Host [LB::server addr]
   }
}

```

Aaron

---

<div class="post-metadata">

**Author:** ![hoolio](https://avatars.discourse-cdn.com/v4/letter/h/f6c823/32.png) [@hoolio](https://community.f5.com/u/hoolio)\
**Post date:** [June 16, 2010, 5:44pm UTC](https://community.f5.com/t/i-will-try-here-modification-http-header/34042/3 "2010-06-16T17:44:58Z")

</div>

Glad to see that worked for you.

Aaron
