Forum Discussion
Irules Data-Group
Lets take 3 examples of the Virtual-servers and with Pool"
a) apuat.leni2.com-VS-HTTP : pool_apuat_leni2.com_http b) apbuild.leni2.com-VS-HTTP : pool_apbuild.leni2.com_http c) apctdev.leni2.com-VS-HTTP : pool_apctdev.leni2.com_http
In every setup we have the respective Irules:
a) apuat.leni2.com-VS-HTTP : pool_apuat_leni2.com_http
when CLIENT_ACCEPTED { set default_pool [LB::server pool] log local0. "Default pool [LB::server pool] set" log local0. "Client IP is [IP::remote_addr]" }
when HTTP_REQUEST { set http_uri [string tolower [HTTP::uri]] log local0. "requested [HTTP::uri]" if {$https_uri equals "/" } { HTTP::redirect "http://www.parveez.com" pool pool_parveez.com-http log local0. "redirected from /"
return
} elseif { $http_uri starts_with "/iss_static" } {
log local0. "matched /iss_static"
pool pool_confarmsp.leni2.com_http
log local0. "pool_confarmsp.leni2.com_http defined, [LB::server pool] selected" return
} elseif { $http_uri starts_with "/"} { log local0. "URI starts with /"
pool pool_apuat_leni2.com_http
log local0. " pool_apuat_leni2.com_http defined, [LB::server pool] selected" return
} else {
log local0. "no match for rev. close connection"
pool pool_apuat_leni2.com_http }
}
=======================
b) apbuild.leni2.com-VS-HTTP : pool_apbuild.leni2.com_http
when CLIENT_ACCEPTED { set default_pool [LB::server pool] log local0. "Default pool [LB::server pool] set" log local0. "Client IP is [IP::remote_addr]" }
when HTTP_REQUEST { set https_uri [string tolower [HTTP::uri]] log local0. "requested [HTTP::uri]" if {$https_uri equals "/" } { HTTP::redirect "https://www.parveez.com" pool pool_www.parveez.com-http
log local0. "redirected from /"
return
} elseif { $https_uri starts_with "/iss_static" } {
log local0. "matched /iss_static"
pool pool_confarmct.leni2.com_http
log local0. "pool_confarmct.leni2.com_http defined, [LB::server pool] selected" return
} else {
log local0. "no match for rev. close connection" pool pool_apbuild.leni2.com_http
}
}
c) apctdev.leni2.com-VS-HTTP : pool_apctdev.leni2.com_http
when CLIENT_ACCEPTED { set default_pool [LB::server pool] log local0. "Default pool [LB::server pool] set" log local0. "Client IP is [IP::remote_addr]" }
when HTTP_REQUEST { set http_uri [string tolower [HTTP::uri]] log local0. "requested [HTTP::uri]" if {$http_uri equals "/" } { HTTP::redirect "http://www.parveez.com" pool pool_parveez.com_http log local0. "redirected from /"
return
} elseif { $http_uri starts_with "/iss_static" } {
log local0. "matched /iss_static"
pool pool_confarmct.leni2.com_http
log local0. "pool_confarmct.leni2.com_http defined, [LB::server pool] selected" return
} elseif { $http_uri starts_with "/" } { pool pool_apctdev.leni2.com_http return
} }
Yes you are close, but wanted to mention the below points:
- If you review the HTTP Profile Irules, we have much in common and we have different pools mentioned into the irule with respect to Virtual-server too, so in place of that we wanted to have a class-group/Data-group.
- So, when a user hit the Virtual-server, the request will check whether it need the static page mentioned by "/iss_static" or to the dynamic page content mentioned in else statement and than to respective pools, but this time not with manual pool we need to specify, we need to specify with the Data-group.
- We want to keep constant the pool marked against iss_static , only we wanted to keep Data-group for the pools mapped against the Else statement( the pool where the traafic will go when it dont match iss_static)
- And for future if any new request comes,apart from Virtual-server creation, we just attach the irule which contains the Data-group which contains all the pool information into that,and in that Data-group we will just add the new pool, so this is to eliminate maximum ofhuman error and operationally also this will be great.
- Can you please assist into this by taking the example of the Three Virtual-Servers:
Example:
a) Virtual-server : apuat.leni2.com-VS-HTTP , Pool : pool_apuat_leni2.com_http b) Virtual-server : apbuild.leni2.com-VS-HTTP , Pool : pool_apbuild.leni2.com_http c) Virtual-server : apctdev.leni2.com-VS-HTTP , Pool : pool_apctdev.leni2.com_http
Thanks and Regards Parveez
Recent Discussions
Related Content
* 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