Forum Discussion

VinceBlack's avatar
VinceBlack
Icon for Altocumulus rankAltocumulus
Feb 02, 2023

Setup a Reverse Proxy that redirects to internal port

Hello All, I am very new to F5 and trying to setup a reverse proxy.

My goal is have a VS that is open publicly on port 443 and have it redirect to backend server that's listening on 8443.  I have tried creating a policy that match HTTP header -->Host that matches a public URL then do the following.. forward traffic to node with ipaddress:8443. I have tried going to pool that has member going to port 8443.  I tried an iRule

when HTTP_REQUEST {
HTTP::redirect "https://[getfield [HTTP::host] ":" 1]:8443[HTTP::uri]" however only 443 is open externally 
}

I'm not sure what I am missing or to search for. I used a Kemp Load balancer and was regex to do reverse proxy to a VIP.

Any help would be grealty appreciated. 

  • I think I got it working. I changed to advance and enabled port translation and seems to be working.

  • I think I got it working. I changed to advance and enabled port translation and seems to be working.

  • Hello, 

    You don't need the redirect iRule if you want F5 to be a reverse proxy. Instead you just have to create a pool with your backend member and the virtual server pointing to this pool. Additionally you may need to set source address translation to automap in your VS settings.

    The redirect iRule will actually redirect the end user to the target you specified and not forward its request internally 

  • Ok I didn't think I was crazy when I first set this up but for the life of me I am unable to get it to work.  I am testing it with another server and it's not working either. My VS is set to port 443. I'm using SSL Profile (Client) "clientssl" SSL Profile (Server) "serverssl". Right now All VLANS and Tunnels with Automap everything else is default.  If I use a backend that is 443 it works but 8443 doesn't