Forum Discussion

NoamRotter's avatar
NoamRotter
Icon for Altostratus rankAltostratus
Jun 18, 2014

Virtual Server redirection

Hello,

 

We have some web apps sitting on different servers and written in different languages. I am trying to implement the following process

 

  • The BIGIP gets a request and checks the URI
  • According to the URI, the BIGIP redirects the request to the correct Virtual Server
  • i.e. if the request is: http://1.1.1.1/abc the BIGIP will redirect the request to virtual server named "abc"
  • The "abc" virtual server will handle the request according to the pool, irules, security policies and etc. As defined in the "abc" virtual server.

I think the best way to accomplish this is by using irules.

 

How should the irule be look like?

 

Thank you. Noam.

 

7 Replies

  • Hi, you can use something like this:

    when HTTP_REQUEST {
    if {[HTTP::uri] contains "/abc" } {
        virtual abc-vs
    }
    }
    
  • Thank youm Vitaliy But unfortunately I got "The page cannot be displayed"

     

    A bit more information how is it configured right now. The Firewall translates the user's request to 1.1.1.1 The "General" Virtual server is listening to this IP. the "abc" virtual server is listening to 1.1.1.2

     

    When using the above irule as the only irule in the "General" virtual server, When I request http://1.1.1.1/abc I get "The page cannot be displayed"

     

    Any ideas?

     

  • Can you post your virtual server configurations? It would help the community diagnose the issue you are having.

     

  • The configurations: Let me know if you need anything else from the conf file.

    ltm virtual-address /Common/1.1.1.1 {
    address 1.1.1.1
    mask 255.255.255.255
    traffic-group /Common/traffic-group-1
    }
    
    ltm virtual /Common/GENERAL {
    destination /Common/1.1.1.1:443
    ip-protocol tcp
    mask 255.255.255.255
    profiles {
        /Common/clientssl {
            context clientside
        }
        /Common/http { }
        /Common/tcp { }
    }
    rules {
        /Common/Redirect_to_VS
    }
    source 0.0.0.0/0
    source-address-translation {
        type automap
    }
    translate-address enabled
    translate-port enabled
    }
    
    ltm rule /Common/Redirect_to_VS {
    when HTTP_REQUEST {
    if {[HTTP::uri] contains "/abc" } {
    virtual abc
    }
    }
    }
    
    ltm virtual /Common/abc {
    destination /Common/1.1.1.2:443
    ip-protocol tcp
    mask 255.255.255.255
    pool /Common/abc
    profiles {
        /Common/clientssl {
            context clientside
        }
        /Common/http { }
        /Common/tcp { }
    }
    rules {
        /Common/Test2
    }
    source 0.0.0.0/0
    source-address-translation {
        type automap
    }
    translate-address enabled
    translate-port enabled
    }
    
    ltm pool /Common/abc {
    description "abc"
    members {
        /Common/abc:80 {
            address 2.2.2.2
        }
    }
    monitor /Common/http 
    }
    
    ltm rule /Common/Test2 {
    when HTTP_REQUEST {
    if { [HTTP::uri] equals "/abc" } {
      HTTP::uri "/abc/Login.asp"
    
    }
    
    }
    }
    
  • So it looks like you are terminating the SSL on your general virtual server (1.1.1.1) and passing it to your abc virtual server (1.1.1.2). Your abc virtual server is also configured with a client SSL profile and is expecting SSL connections, but the layered configuration you have in place (general -> abc virtual server mapping) will send non-SSL traffic to your abc virtual server.

     

    Try removing your client SSL profile from your abc virtual server and see if that works.

     

  • The configurations: Let me know if you need anything else from the conf file.

     

    i understand you have to assign serverssl profile to the general virtual server because abc virtual server is https.