Forum Discussion

Kevin_Anderson1's avatar
Kevin_Anderson1
Icon for Nimbostratus rankNimbostratus
Dec 05, 2011

Unique HTTP Proxy Situation - suggestions?

Operating System: LTM 9.3.1 (ugh)

 

 

Situation: We have a single externally available virtual server that handles all of the traffic to our main web presence (www.company.com) and an iRule that directs requests to the appropriate pool based off of URI. This rule uses when HTTP_REQUEST and captures host and uri to variables, using a switch statement against them -- pretty straightforward.

 

 

 

A need has arisen to continue to use the www.company.com external name, but direct certain URIs to a third-party without re-directing to a different domain name. Meaning, the client browser always appears to be accessing www.company.com/thirdparty, but the actual flow of traffic would be user -> our external F5 Virtual Server -> third party.

 

 

 

My initial suggestion was to grab the www.company.com/thirdparty request, rewrite it as thirdparty.company.com/thirdparty and handle it that way, but it appears the business would prefer we proxy this traffic. And hence, this forum post!

 

 

 

Is this possible? Any starting points if so?

 

1 Reply

  • is it something like this?

    [root@ve1023:Active] config  b virtual bar list
    virtual bar {
       snat automap
       pool foo
       destination 172.28.19.79:80
       ip protocol 6
       rules myrule
       profiles {
          http {}
          tcp {}
       }
    }
    [root@ve1023:Active] config  b pool foo list
    pool foo {
       members 200.200.200.101:80 {}
    }
    [root@ve1023:Active] config  b rule myrule list
    rule myrule {
       when HTTP_REQUEST {
            if {[string tolower [HTTP::host]] equals "www.company.com"} {
                    if {[string tolower [HTTP::uri]] starts_with "/thirdparty"} {
                            HTTP::header replace Host "thirdparty.company.com"
                    }
            }
    }
    }
    
    [root@ve1023:Active] config  ssldump -Aed -nni 0.0 port 80
    New TCP connection 1: 172.28.19.253(45435) <-> 172.28.19.79(80)
    1323150377.0352 (0.0038)  C>S
    ---------------------------------------------------------------
    GET /thirdparty/bhabhabha HTTP/1.1
    User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8r zlib/1.2.3 libidn/0.6.5
    Host: www.company.com
    Accept: */*
    
    ---------------------------------------------------------------
    
    New TCP connection 2: 200.200.200.10(45435) <-> 200.200.200.101(80)
    1323150377.0363 (0.0009)  C>S
    ---------------------------------------------------------------
    GET /thirdparty/bhabhabha HTTP/1.1
    User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8r zlib/1.2.3 libidn/0.6.5
    Host: thirdparty.company.com
    Accept: */*
    
    ---------------------------------------------------------------