Forum Discussion
Jon_46219
Nimbostratus
May 06, 2010Cath error and print virtual server
I have an Irule where I execute: "HTTP::header insert X-Forwarded-For..." and sometimes I get an error.
I have this irule applied in serveral virtual servers so I don't know in which one is ...
hoolio
Cirrostratus
May 11, 2010I agree with Michael that inserting the XFF header using a custom HTTP profile is simpler, more efficient and won't be susceptible to this issue. If you did want to get more information from the iRule, you could log the virtual server name before attempting the header insert. This way you're sure to get the debug logging before the runtime TCL error occurs. Also, you can use the virtual command to log the virtual server name:
http://devcentral.f5.com/wiki/default.aspx/iRules/virtual
when HTTP_REQUEST {
log local0. "[IP::client_addr]:[TCP::client_port]: Inserting X-Forwarded-For for [virtual name]"
HTTP::header insert X-Forwarder-For [IP::client_addr]
}
The actual TCL error is probably caused by a conflict between an iRule redirect and header insert. If you do need to use an iRule to do the header insert and you're doing a redirect in the same or another iRule, you can add logic to prevent both the redirect and header insert from triggering on the same HTTP request.
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
