Forum Discussion

Janez's avatar
Janez
Icon for Nimbostratus rankNimbostratus
Jan 29, 2020

2 different URI (on the same VIP) call to same server

Hi Team,

 

I needs to create irule (or policy) for the below request, please suggest me how to do:

 

Calls https://test.com should to go real server with https://192.168.10.5

Calls https://test.com/NAS should to go real server with https://192.168.10.5/NAS

 

and also on secondary link https://test.com/NAS is present authentication with certificate for app.

 

Thanks

 

2 Replies

  • How many Pool members are there behind application "test.com", If only one then all request will be served to node "192.168.10.5" and simple iRule is enough to serve request. No issue with SSL certificate.

    when HTTP_REQUEST {
          if {[HTTP::host] ne ""}{
                HTTP::respond 301 Location "https://[getfield [HTTP::host] ":" 1][HTTP::uri]"
       } else {
                HTTP::respond 301 Location "https://[IP::local_addr][HTTP::uri]"
       }
    } 

    Hope it will work for you.

  • Janez's avatar
    Janez
    Icon for Nimbostratus rankNimbostratus

    Hello Samir,

     

    It is just one pool member.

     

    What do you mean with "if {[HTTP::host] ne ""}" I don't now what "ne" mean?. So this iRule should work?

     

    Thanks