{"id":647,"date":"2012-02-20T15:50:21","date_gmt":"2012-02-20T15:50:21","guid":{"rendered":"https:\/\/fir3netwp.gmsrrpobkbd.com\/2012\/02\/20\/brocade-adx-csw-nested-rules\/"},"modified":"2021-07-24T18:19:24","modified_gmt":"2021-07-24T18:19:24","slug":"brocade-adx-csw-nested-rules","status":"publish","type":"post","link":"https:\/\/www.fir3net.com\/Loadbalancers\/Brocade\/brocade-adx-csw-nested-rules.html","title":{"rendered":"Brocade ADX – CSW nested rules"},"content":{"rendered":"
Nested CSW rules provides the ability to perform Boolean (AND, OR etc) based conditions on standard csw rules.<\/p>\n
Within this example we will be :<\/p>\n
First of all the csw rules are created (including the csw nested-rules).<\/p>\n
csw-rule \"csw-rule1\" header \"Host\" equals \"PRODUCTION.example.com\"
csw-rule \"csw-rule2\" header \"Host\" equals \"STAGING.example.com\"
csw-rule \"csw-rule3\" url prefix \"\/FOLDER\/index.html\"
csw-rule \"csw-rule1-nested\" nested-rule \"csw-rule1 && csw-rule3\"
csw-rule \"csw-rule2-nested\" nested-rule \"csw-rule2 && csw-rule3\"<\/pre>\nCSW Policy<\/strong><\/h3>\n
We then create a csw policy. This defines actions for each of the csw rules when matched.<\/p>\n
csw-policy CSW-POLICY
match \"csw-rule1-nested\" redirect \"*\" \"\/REDIRECT\/index.html\" 80 301
match \"csw-rule2-nested\" forward 1
match \"csw-rule3\" forward 1024<\/pre>\nVirtual \/ Real Servers<\/strong><\/h3>\n
Finally each of the servers are defined a server-id and a group-id. CSW is also enabled and the csw policy associated to the virtual server.<\/p>\n
server real REALSERVER1 192.168.1.11
port http
port http keepalive
port http url \"HEAD \/index.html\"
port http server-id 1024
port http group-id 1 1
server real REALSERVER2 192.168.1.12
port http
port http keepalive
port http url \"HEAD \/index.html\"
port http server-id 1025
port http group-id 1 2
server real REALSERVER3 192.168.1.13
port http
port http keepalive
port http url \"HEAD \/index.html\"
port http server-id 1026
port http group-id 1 3
server virtual VIRTUALSERVER 172.16.1.100
port http
port http keepalive
port http csw
port http csw-policy \"CSW-POLICY\"
port http REALSERVER1 http
port http REALSERVER2 http
port http REALSERVER3 http<\/pre>\n","protected":false},"excerpt":{"rendered":"Nested CSW rules provides the ability to perform Boolean (AND, OR etc) based conditions on standard csw rules. Within this example we will be : Redirecting any request that has a host header of ‘PRODUCTION.example.com’ and containing a URL request for \/FOLDER\/index.html to ‘\/REDIRECT\/index.html’ Balancing any request that has a host header of ‘STAGING.example.com’ and … Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[],"yoast_head":"\n
Brocade ADX - CSW nested rules - Fir3net<\/title>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\n\t\n\t\n