Forum Discussion
ibrahim_37929
Aug 16, 2016Nimbostratus
delete port i rule with specific address
Hi i use an i rule for deleting ports on application servers. But the problem is when i called the ip address:port of an application server i rule deletes the ports of application server. So i want t...
Kai_Wilke
Aug 16, 2016MVP
Hi Ibrahim,
you may take a look to the iRule below. It used a less complex syntax using the
[URI::*]
commands to parse the original Location
header to decide if a rewrite is needed. But also uses a -glob
based [string match]
command to identify IPs within the host values.
when HTTP_RESPONSE {
if { [set http_location [HTTP::header value "Location"]] ne "" } then {
if { ( [set uri_port [URI::port $http_location]] >= 9080 ) and
( $uri_port <= 9199 ) and not
( [string match {[0-9]*.[0-9]*.[0-9]*.[0-9]*} [URI::host $http_location]] ) } then {
HTTP::header replace Location "[substr $http_location 0 ":$uri_port"][findstr $http_location ":$uri_port" 5]"
}
}
}
Cheers, Kai
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