Forum Discussion
Sep 19, 2014
BIG-IP add custom header
F5 BIG-IP LTM VE v11.4.0 on ESXi
I want to add a custom header to my request before rewriting to a backend server :
when HTTP_REQUEST {
HTTP::header insert uri-original [HTTP::uri]
...
...
nitass
Employee
could you please elaborate ?
e.g.
configuration
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm virtual bar
ltm virtual bar {
destination 172.28.24.10:80
ip-protocol tcp
mask 255.255.255.255
pool foo
profiles {
http { }
tcp { }
}
rules {
rule1
rule2
}
source 0.0.0.0/0
source-address-translation {
type automap
}
vs-index 3
}
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm rule rule1
ltm rule rule1 {
when HTTP_REQUEST priority 1 {
HTTP::redirect "http://www.google.com"
}
}
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm rule rule2
ltm rule rule2 {
when HTTP_REQUEST priority 2 {
HTTP::header insert test 1234
}
}
/var/log/ltm
[root@ve11a:Active:In Sync] config tail -f /var/log/ltm
Nov 23 22:21:35 ve11a err tmm1[14890]: 01220001:3: TCL error: /Common/rule2 - Operation not supported (line 1) invoked from within "HTTP::header insert test 1234"
Nov 23, 2014
so in your example an error is thrown because we attempt to add a header to a request for which a response has already been set ? however, in my case, my add header irule has priority 1 - it always fires first - so it would seem your example would not apply
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects