# BIG-IP : http profile : insert multiple headers

**URL:** <https://community.f5.com/t/big-ip-http-profile-insert-multiple-headers/18250>\
**Category:** Technical Forums\
**Tags:** big-ip, design, header-insert, ltm, application-delivery, http-profile\
**Created:** [August 4, 2015, 8:04pm UTC](https://community.f5.com/t/big-ip-http-profile-insert-multiple-headers/18250 "2015-08-04T20:04:33Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![BaltoStar\_12467](https://avatars.discourse-cdn.com/v4/letter/b/df705f/32.png) [@BaltoStar\_12467](https://community.f5.com/u/BaltoStar_12467)\
**Post date:** [August 4, 2015, 8:04pm UTC](https://community.f5.com/t/big-ip-http-profile-insert-multiple-headers/18250/1 "2015-08-04T20:04:33Z")

</div>

F5 BIG-IP Virtual Edition v11.4.1 (Build 635.0) LTM on ESXi

Via the web-admin, I can create/edit an

```tcl
http profile

```

and set this field :

```tcl
Request Header Insert = "X-Forwarded-Proto:http"

```

But what if I want to insert multiple headers ?

What is the syntax ?

Further, does

```tcl
Request Header Insert

```

erase any pre-existing request headers ?

Also, I set

```tcl
Insert X-Forwarded-For

```

to

```tcl
Enabled

```

but logs do not show header

```tcl
X-Forwarded-For

```

to be present.

---

<div class="post-metadata">

**Author:** ![Brad\_Parker\_139](https://avatars.discourse-cdn.com/v4/letter/b/b9e5f3/32.png) [@Brad\_Parker\_139](https://community.f5.com/u/Brad_Parker_139)\
**Post date:** [August 4, 2015, 9:29pm UTC](https://community.f5.com/t/big-ip-http-profile-insert-multiple-headers/18250/2 "2015-08-04T21:29:38Z")

</div>

You must use an iRule to insert more than one I believe. To do it with an iRule you can do something simple like this:

```tcl
when HTTP_REQUEST {
    HTTP::header insert [list X-Forwarded-Proto http header2 value2 headerN valueN]
}

```

> **[DevCentral - An F5 Technical Community](https://community.f5.com/)**
>
> DevCentral is an online technical community where engineers and practitioners collaborate, share knowledge, and solve problems related to F5 technologies and industry trends.

---

<div class="post-metadata">

**Author:** ![Brad\_Parker](https://avatars.discourse-cdn.com/v4/letter/b/a87d85/32.png) [@Brad\_Parker](https://community.f5.com/u/Brad_Parker)\
**Post date:** [August 4, 2015, 9:29pm UTC](https://community.f5.com/t/big-ip-http-profile-insert-multiple-headers/18250/3 "2015-08-04T21:29:38Z")

</div>

You must use an iRule to insert more than one I believe. To do it with an iRule you can do something simple like this:

```tcl
when HTTP_REQUEST {
    HTTP::header insert [list X-Forwarded-Proto http header2 value2 headerN valueN]
}

```

[https://devcentral.f5.com/wiki/iRules.HTTP\_\_header.ashx](https://devcentral.f5.com/wiki/iRules.HTTP__header.ashx)

---

<div class="post-metadata">

**Author:** ![BaltoStar\_12467](https://avatars.discourse-cdn.com/v4/letter/b/df705f/32.png) [@BaltoStar\_12467](https://community.f5.com/u/BaltoStar_12467)\
**Post date:** [August 5, 2015, 12:54am UTC](https://community.f5.com/t/big-ip-http-profile-insert-multiple-headers/18250/4 "2015-08-05T00:54:20Z")

</div>

Thanks Brad - could you please also take a look at my amended question ?

---

<div class="post-metadata">

**Author:** ![BaltoStar\_12467](https://avatars.discourse-cdn.com/v4/letter/b/df705f/32.png) [@BaltoStar\_12467](https://community.f5.com/u/BaltoStar_12467)\
**Post date:** [August 5, 2015, 12:54am UTC](https://community.f5.com/t/big-ip-http-profile-insert-multiple-headers/18250/5 "2015-08-05T00:54:20Z")

</div>

Thanks Brad - could you please also take a look at my amended question ?

---

<div class="post-metadata">

**Author:** ![Stan\_Ward](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@Stan\_Ward](https://community.f5.com/u/Stan_Ward)\
**Post date:** [April 27, 2018, 7:36pm UTC](https://community.f5.com/t/big-ip-http-profile-insert-multiple-headers/18250/6 "2018-04-27T19:36:18Z")

</div>

This is an old question, but I noticed (v13.1.0.5) that the GUI help for Request Header Insert specifically says that multiple headers may be inserted, but does not indicate the syntax.

“Type a string that the system inserts as a header in an HTTP request. If the header exists already, the system does not replace it. For multiple header insertions, both LTM Policies and iRules support inserting multiple headers into a request”

I’ve tried separating by spaces (as is indicated for Allowed Headers) or \n , but only the last header is inserted correctly, i.e.:

```tcl
Header1:yes Header2:no

```

comes out on a single line as:

```tcl
Header1 yes Header2=no

```

---

<div class="post-metadata">

**Author:** ![Stan\_Ward](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@Stan\_Ward](https://community.f5.com/u/Stan_Ward)\
**Post date:** [April 27, 2018, 7:36pm UTC](https://community.f5.com/t/big-ip-http-profile-insert-multiple-headers/18250/7 "2018-04-27T19:36:18Z")

</div>

This is an old question, but I noticed (v13.1.0.5) that the GUI help for Request Header Insert specifically says that multiple headers may be inserted, but does not indicate the syntax.

“Type a string that the system inserts as a header in an HTTP request. If the header exists already, the system does not replace it. For multiple header insertions, both LTM Policies and iRules support inserting multiple headers into a request”

I’ve tried separating by spaces (as is indicated for Allowed Headers) or \n , but only the last header is inserted correctly, i.e.:

```tcl
Header1:yes Header2:no

```

comes out on a single line as:

```tcl
Header1 yes Header2=no

```

---

<div class="post-metadata">

**Author:** ![Kevin\_Davies](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/kevin_davies/32/1696_2.png) [@Kevin\_Davies](https://community.f5.com/u/Kevin_Davies)\
**Post date:** [September 6, 2018, 2:17am UTC](https://community.f5.com/t/big-ip-http-profile-insert-multiple-headers/18250/8 "2018-09-06T02:17:41Z")

</div>

Try a semicolon as a seperator

---

<div class="post-metadata">

**Author:** ![Kevin\_Davies](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/kevin_davies/32/1696_2.png) [@Kevin\_Davies](https://community.f5.com/u/Kevin_Davies)\
**Post date:** [September 6, 2018, 2:17am UTC](https://community.f5.com/t/big-ip-http-profile-insert-multiple-headers/18250/9 "2018-09-06T02:17:41Z")

</div>

Try a semicolon as a seperator
