iRule to read URI then point to the desired pool
I have a requirement to read a URL where the host and port are static https:/// But the URI changes. Based on the URI, I need to load balance to a server pool answering tcp/8443 or tcp/8444, or tcp/8445.
I have created an iRule that is already recognizing the URI and forwarding to the correct server pool. The HTTP page completes as long as the request is forwarded on to the 8443. If the URI match send the client to either the 8444 or 8445 pool, I get an HTTP 404 error.
No using the VIP by HTTPS directly to the pool node IP, on the redirected port number works.
Here is a copy of the iRule that is working to send sessions to the correct pool based on the uri.
Please give me some direction as to what I need to do to correct the HTTP 404 error.
when HTTP_REQUEST { switch -glob [HTTP::uri] { "/ent-inventory-services" { pool pools_sss_dev_8443 } "/ent-customer-services" { pool pools_sss_dev_8443 } "/ent-security-services" { pool pools_sss_dev_8443 } "/ent-payment-services" { pool pools_sss_dev_8443 } "/ent-agreement-services" { pool pools_sss_dev_8443 } "/ent-misc-services" { pool pools_sss_dev_8443 } "/ent-ht-services" { pool pools_sss_dev_8444 } "/customer" { pool pools_sss_dev_8445 } "/inventory*" { pool pools_sss_dev_8445 } "/agreements" { pool pools_sss_dev_8445 } "/ent-exception-services" { pool pools_sss_dev_8445 } "/payment" { pool pools_sss_dev_8445 } "/ent-report-services" { pool pools_sss_dev_8445 } default { Default - not matching any URI pool pools_sss_dev_default } } }