Forum Discussion
Pat_Fiorino_287
Mar 14, 2007Historic F5 Account
simple iRule for restricting access
I am using a simple iRule to restrict access and give a message as follows:
when HTTP_REQUEST {
if {[matchclass [IP::remote_addr] equals $::ip_list]}
{[HTTP::respond 200 content "Sorry
This is a restricted site"]
}
else {
pool web_pool
}
}
This iRule works fine with an http virtual server.
However when i create a simple https virtual server with a simple client ssl profile I get a connection reset.
Am I missing something obvious?
I have tried with version 9.4 and version 9.2.4
thx
- Try taking away the brackets from around the HTTP::respond command
when HTTP_REQUEST { if {[matchclass [IP::remote_addr] equals $::ip_list]} { HTTP::respond 200 content "SorryThis is a restricted site" } else { pool web_pool } }
use brackets to return value set host [HTTP::host] do not use brackets when setting or calling a command HTTP::host "www.foo.com"
when HTTP_REQUEST { log local0. "client address: [IP::remote_addr]" if {[matchclass [IP::remote_addr] equals $::ip_list]} { log local0. "Client is bad, sending http response message..." HTTP::respond 200 content "SorryThis is a restricted site" } else { log local0. "Client is good, passing along to pool web_pool" pool web_pool } }
- Pat_Fiorino_287Historic F5 AccountI took out the brackets and everything works fine.
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