Forum Discussion
jaskel_40663
Nimbostratus
Apr 29, 2008Block specific URI
I have a need to block a specific uri as well as insert the client IP address into the HTTP header. I have the HTTP header insertion iRule and it works well:
when HTTP_REQUEST {
...
hoolio
Cirrostratus
Apr 30, 2008I think you're getting the TCL error because you've already issued a redirect from one rule and then are trying to insert a header in the request. If you do combine the rules, you could add them to an if/else block and eliminate this error:
when HTTP_REQUEST {
Respond to requests for server-status
if {[HTTP::uri] contains "server-status"} {
Send HTTP 200 response
HTTP::respond 200 content "Error"
} else {
Remove existing Client-IP headers
while {[HTTP::header exists "Client-IP"]} {
HTTP::header remove "Client-IP"
}
Insert the original client IP address in the Client-IP header
HTTP::header insert "Client-IP" [IP::client_addr]
}
}Aaron
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
