Forum Discussion
BIG-IP : http profile : insert multiple headers
F5 BIG-IP Virtual Edition v11.4.1 (Build 635.0) LTM on ESXi
Via the web-admin, I can create/edit an
http profile
and set this field :
Request Header Insert = "X-Forwarded-Proto:http"
But what if I want to insert multiple headers ?
What is the syntax ?
Further, does
Request Header Insert
erase any pre-existing request headers ?
Also, I set
Insert X-Forwarded-For
to Enabled
but logs do not show header X-Forwarded-For
to be present.- Brad_ParkerCirrus
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:
when HTTP_REQUEST { HTTP::header insert [list X-Forwarded-Proto http header2 value2 headerN valueN] }
- Thanks Brad - could you please also take a look at my amended question ?
- Stan_WardAltocumulus
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.:
Header1:yes Header2:no
comes out on a single line as:
Header1 yes Header2=no
Try a semicolon as a seperator
- Brad_Parker_139Nacreous
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:
when HTTP_REQUEST { HTTP::header insert [list X-Forwarded-Proto http header2 value2 headerN valueN] }
- Thanks Brad - could you please also take a look at my amended question ?
- Stan_WardAltocumulus
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.:
Header1:yes Header2:no
comes out on a single line as:
Header1 yes Header2=no
Try a semicolon as a seperator
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