Forum Discussion
mark_beynon_593
Nimbostratus
Apr 16, 2008More efficient stream iRule
I am very new to iRules, so be patient but have an interesting problem to overcome.
Note all access is via HTTPS:
requirement: remove external access to robots.txt file and an admin page that can not be restricted on the server it self.
our original solution:
use an iRule with a HTTP Profile to redirect the request to an error page when "robots.txt" or "admin" is found in the URI.
This worked fine, apart from it broke some of the extended capability of the website:- The website also offers tunneled TS an Citrix through a client side applet.
With HTTP profile applied the tunneled TS/Citrix are not understood and no longer work.
Revised solution:
Use a Stream to replace "robots.txt" and "admin" in the content with "error". The replacement term error would cause an unknown URL, and the server would redirect to the front page.
This works fine.
But i am sure there will be some clever ways of doing this with an iRule? such as only checking requests
any suggestions for how to do this?
Thanks
- The_Bhattman
Nimbostratus
It sounds similiar to what is being discussed in another posting (Click here) - mark_beynon_593
Nimbostratus
close, but fundamentally different. that post dynamically creates a robot.txt file. I am trying to disable robots.txt file, and block a url. Also the use of the HTTP profile would break my apps, hence the posts can not be considered together. - Eduardo_Saito_1
Nimbostratus
Hi.when CLIENT_ACCEPTED { TCP::collect } when CLIENT_DATA { if { [TCP::payload] contains "robots.txt" } { Close TCP Conn TCP::close } TCP::release TCP::collect }
- mark_beynon_593
Nimbostratus
Thanks for your suggestion Esaito, i will have a play with this. - bl0ndie_127134Historic F5 AccountIf you can detect the tunneled connections (via uri or port etc.), you can disable the HTTP profile dynamically using the HTTP::disable command.
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