Forum Discussion

MeAndMyBIGIP_60's avatar
MeAndMyBIGIP_60
Icon for Nimbostratus rankNimbostratus
Sep 02, 2009

Nesting a redirect to another pool?

So I have an existing HTTP > HTTPS redirect rule running fine that's running on Pool1:

when HTTP_REQUEST { 
 HTTP::redirect https://[HTTP::host][HTTP::uri] 
 }

I have another, Pool2, that I'd like to make visible without having to get another firewall hole & external IP going

Pool 1, site https://www.foo.com

Pool 2, site http://www.bar.com

Would like to have http://www.foo.com redirect to https://www.foo.com (this runs fine)

Would also like to have http://www.foo.com/bar redirect to http://www.bar.com

I had tried

when HTTP_REQUEST { 
 HTTP::redirect https://[HTTP::host][HTTP::uri] 
 if {[HTTP::uri] equals {www.foo.com/bar}} {pool Bar_Pool} 
 } 
 }

but i get 404 errors, presumably because there is no "/bar" folder on the Bar_Pool servers

can I do this somehow?

11 Replies

  • First of all, thanks everyone for your patience here... incredibly helpful.

    As for Joe's request, here goes:

    Conceptually, the only content that should be going to an atypical destination is anything that's called by http://www.foo.com/bar. That content is being provided by the default website "/" on the nodes in Pool2.

    Anything else should be 1st redirected as HTTPS traffic, with content being provided by the nodes in Pool1.

    I've been tinkering with these based on the iRule sample found here (http://devcentral.f5.com/wiki/default.aspx/iRules/ClonePoolBasedOnUri.html), and have combined them somewhat successfully:

    when HTTP_REQUEST {  
     if { [HTTP::uri] starts_with "/sp2010" } { 
         pool AlphaSP2010_pool } 
     else {  
      HTTP::redirect https://[HTTP::host][HTTP::uri] 
      }  
      }

    The problem I outlined in the previous post has been resolved by editing the Sharepoint AAM, so now I'm at least hitting the nodes in Pool2 correctly, but we're not stopping at the default website "/" we're instead going a folder deeper to "/sp2010"

    So in line 3, how do I tell it to use the AlphaSP2010_pool and call the site that lives at http://nodeX/? Can I do that, or as Joe suggested, do I need to replace "/sp2010" with "/SitePages/Home.aspx" somehow?