Forum Discussion

Sachin_Dixit_13's avatar
Sachin_Dixit_13
Icon for Nimbostratus rankNimbostratus
Mar 03, 2014

Integration of reverse proxy with Squid proxy

Hello Aron,

 

I want to integate F5 LTM VE 11.3.0 with squid proxy server wherein end user will hit https://abc.123.com. We have certificate for 123.com which is getting offloaded at F5. End user request of https://abc.123.com. from F5 should be rewritten to https:// xyz.456.com & then we are want to direct this rewrite qurery to pool squid so that we can leaverage full functionality of proxy server however we get following error

 

"Unsupported Request Method and Protocol

 

Squid does not support all request methods for all access protocols. For example, you can not POST a Gopher request.

 

"

 

Please suggest for irul.

 

Thanks in advance

 

2 Replies

  • Hi!

    Have you assigned a server ssl profile? Otherwise the request might use http to contact a https listener which could generate the error you describe.

    Just out of curiosity, if you want to offload the squid server by using the F5, why do you still send the traffic to https instead of http?

    As for the iRule, try something like this:

    when HTTP_REQUEST {
    
        set host [string tolower [HTTP::uri]]
    
        The condition below can be omitted in case you want to rewrite all requests
        if { $host eq "abc.123.com" } {
            [HTTP::host] "xyz.456.com"
        }
    
    } 
    

    Good luck!

    /Patrik

  • Hi Sachin!

    From your description you basically want to bounce connections from external users via your load balancer to an external website.

    If this is the case you need to:

    Create a pool and add the IP (or IP's if you will) of the external site as a member.

    Create an iRule for host header rewriting:

    when HTTP_REQUEST {
    
            [HTTP::host] "xyz.456.com"
    
    }
    

    Create a VIP with:

    • HTTP profile
    • Client SSL profile
    • Server SSL profile
    • SNAT pool, or SNAT (you can use SNAT automap for this, or create a new pool). Note that if your F5 is not located on the internet you will need to NAT the request sent by the F5 to a public IP before leaving your network. The SNAT pool settings is located under "Source Address Translation" when creating the VIP.
    • If the external site has multiple IP's you need to add a persistence profile too.
    • Assign the pool you created as default pool.
    • Assign the iRule you created.

    Then open the firewall and add any internal to public NAT's you need.

    Good luck!

    /Patrik