Forum Discussion

big_9869's avatar
big_9869
Icon for Nimbostratus rankNimbostratus
May 24, 2013

http redirect via tcp

Hi Everyone

 

 

I need to generate a redirect on the http ports 80 and 443. I want to use tch and not an http redirect since the vip is ageneral TCP one.

 

I have to assume if this can be done with http it can also be done with tcp.

 

 

I.E. redirect from this vip to somplace.com oth the like.......

 

 

ideas welcome

 

 

thanks

 

 

3 Replies

  • Assuming you're also terminating SSL on your 443 VIP, something like this should work:

    
    TCP::respond "HTTP/1.1 302 Found\r\nLocation: http://www.google.com\r\n\r\n"
    
  • Assuming you're also terminating SSL on your 443 VIP, something like this should work: just wondering shouldn't it be SSL::respond rather than TCP::respond (because it is https).

    [root@ve10:Active] config  b virtual bar list
    virtual bar {
       snat automap
       pool foo
       destination 172.28.19.252:443
       ip protocol 6
       rules myrule
       profiles {
          clientssl {
             clientside
          }
          tcp {}
       }
    }
    [root@ve10:Active] config  b rule myrule list
    rule myrule {
       when CLIENTSSL_HANDSHAKE {
      SSL::respond "HTTP/1.1 302 Found\r\nLocation: http://www.google.com\r\n\r\n"
    }
    }
    [root@ve10:Active] config  curl -Ik https://172.28.19.252
    HTTP/1.1 302 Found
    Location: http://www.google.com