Forum Discussion

Joe_5599_134300's avatar
Joe_5599_134300
Icon for Nimbostratus rankNimbostratus
Jan 23, 2014

HTTSP Inbound Then Filter on /URI for Pool Selection iRule

when HTTP_REQUEST { Get client IP address set src_ip [IP::client_addr] set header value HTTP_VIA to the client IP address HTTP::header insert "VIA" $src_ip

route to pool based on URI value
switch -glob [string tolower [HTTP::uri]] {
    "/appsite1*" {
        pool app2.testone.test.com-8080
    }
    "/appsite2*" {
        pool app2.testone.test.com-8081
    }
    "/appsite3*" {
        pool app2.testone.test.com-8085
    }
    "/appsite4*" {
        pool app2.testone.test.com-9080
    }
    default {
        set http_reply "You have reached [HTTP::host], though the URL is incomplete or incorrect. 

Please contact Customer Support at 800-xxx-xxxx if you continue to have trouble." HTTP::respond 200 content $http_reply } }

6 Replies

  • Basically have a HTTPS 443 VS inbound with SSL offloading on the F5. I need to be able to filter on the /appsite1 or /appsiteX and then have irule direct to the proper pools. I have setup 4 pools with member node listening on custom port.

     

    doesn't the irule you posted work?

     

    • Joe_5599_134300's avatar
      Joe_5599_134300
      Icon for Nimbostratus rankNimbostratus
      No, except the default section/action. Not sure I need the set SRC_IP and http header insert Client IP address, this was probably used for another setup in the past. Not sure the irule is looking for /appsite1 /appsite2, etc. Example https://app2.testone.test.com/appsite1
  • Basically have a HTTPS 443 VS inbound with SSL offloading on the F5. I need to be able to filter on the /appsite1 or /appsiteX and then have irule direct to the proper pools. I have setup 4 pools with member node listening on custom port.

     

    doesn't the irule you posted work?

     

    • Joe_5599_134300's avatar
      Joe_5599_134300
      Icon for Nimbostratus rankNimbostratus
      No, except the default section/action. Not sure I need the set SRC_IP and http header insert Client IP address, this was probably used for another setup in the past. Not sure the irule is looking for /appsite1 /appsite2, etc. Example https://app2.testone.test.com/appsite1
  • No, except the default section/action.

    have you tried "curl" against pool member from cli? did it work?

    e.g.

     curl -I http://pool_member_ip:pool_member_port/appsiteX/ -H "Host: virtual_server_fqdn"