Rafish_129330
May 22, 2018Nimbostratus
help with irule
Hi,
I need to write irule that 1. drop connection to uri that contain "wp-admin" "login" "mydb" from specific ip address 2. allow access to uri that contain "admin-ajax.php"
This is the irule i wrote: when HTTP_REQUEST {
check the Class to determine if it's not allowed deny access to wordpress /admin and /login from external ip address Allow only My ip address to connect wordpress /admin and /login Allow access to any host that contains "admin-ajax.php"
if {[HTTP::uri] contains "admin-ajax.php"} { log local0. "admin-ajax request accepted from client: [IP::client_addr]"
} elseif {[HTTP::uri] contains "wp-admin" || [HTTP::uri] contains "login" || [HTTP::uri] contains "mydb"} { if {not[class match [IP::client_addr] equals Technion_ip_Address] } { log local0. "dropped connection My ip address[IP::client_addr]" } else { reject } } }
Unfortunately the irule does not work, after the first if everything pass.
Suggestions please
Regards Rafi