Forum Discussion

RobS's avatar
RobS
Icon for Altostratus rankAltostratus
Jan 25, 2013

Proxy External Virtual Server to Internal non-LTM website v11.2.1

I've been asked if I can create an external public facing VS that brings users to an internal website that has no association with the F5 (ie http://external-site.com -> http://internal-site.com/abc/def/site.aspx). And the URI should stay with the external VS address. I see the ProxyPass iRules but they state you need to have a default pool defined for the VS and in my case there are no pool members. I also saw an iRule using HTTP::collect where it looks like the F5 basically caches the page and then writes it back to the client, but I'm weary of that because there were warnings about running out of memory. I can't use a simple redirect because outside users wouldn't have access to the internal server.

 

Any thoughts on how to best accomplish this are greatly appreciated!

 

Thanks,

 

Rob

 

7 Replies

  • RobS's avatar
    RobS
    Icon for Altostratus rankAltostratus
    Hi Steve,

     

     

    If I add it as a pool member and then create the default pool wouldn't the VS would try to send traffic to that server by default if no iRule prevented it 1st? The default website on that server is not the one we are going after and would not want it available externally. I was also trying not to add the server to our LTM since it is on an internal subnet that the F5 doesn't own. We created specific subnets that the LTM is the default gateway for used by our load balanced servers.

     

     

    Thanks,

     

    Rob
  • OK, perhaps you should clarify the requirements here. I understand them as;

     

     

    1) You want external users to resolve external-site.com to the IP address of a VS running on your F5

     

    2) You want the F5 to pass the traffic to an internal host

     

    3) You want the F5 to rewrite the domain name in the requests from external-site.com to internal-site.com

     

     

    Am I correct?
  • is this usable?

    [root@ve10:Active] config  b virtual bar list
    virtual bar {
       destination 172.28.19.252:80
       ip protocol 6
       rules myrule
       profiles {
          http {}
          tcp {}
       }
    }
    [root@ve10:Active] config  b rule myrule list
    rule myrule {
       when HTTP_REQUEST {
      switch [string tolower [HTTP::path]] {
        "/" {
          HTTP::header replace Host "internal-site.com"
          HTTP::uri "/abc/def/site.aspx"
          snat automap
          node 200.200.200.101 80
        }
        default {
           do something
          reject
        }
      }
    }
    }
    
    [root@ve10:Active] config  ssldump -Aed -nni 0.0 port 80
    New TCP connection 1: 172.28.19.251(47631) <-> 172.28.19.252(80)
    1359177477.6073 (0.0011)  C>S
    ---------------------------------------------------------------
    GET / HTTP/1.1
    User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
    Accept: */*
    Host: external-site.com
    
    ---------------------------------------------------------------
    
    New TCP connection 2: 200.200.200.253(47631) <-> 200.200.200.101(80)
    1359177477.6131 (0.0035)  C>S
    ---------------------------------------------------------------
    GET /abc/def/site.aspx HTTP/1.1
    User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
    Accept: */*
    Host: internal-site.com
    
    ---------------------------------------------------------------
    
  • RobS's avatar
    RobS
    Icon for Altostratus rankAltostratus

    Hi Steve- That is correct, that is what I am trying to do.

     

    Hi nitass- Thank-you for your iRule suggestion. It does get the page to load and rewrites the header so the address stays with the external site name. The problem I know have is that there is an external style sheet that is not able to resolve to and none of the links on the page work either. I think it might be trying to append their paths to the external site name instead of the internal host. Do I need some sort of loop so it knows to always go to the internal host, but continue to rewrite the header?

     

    Thank-you both for your help!

     

    Rob

     

  • Before we waste lots of time on this I think it might be useful for you to do a packet capture on a client and actually confirm what the issues are please. That or please provide far more detail on where the css is located, how it is called in the HTML and what the links actually look like now and how they should look. A stream profile might solve this but I'd need more detail to know.