I have haproxy server running on linode port 80 that redirects traffic to on premise haproxy port 8082
--- linode node,
|
VPN
|
--- onpremise haproxy node
and I have another node on premise that is not on the vpn for security reason.
I want to redirect traffic from linode:80 to on_premise via haproxy:8082
is it possible ?
I have been thinking to use (on linode)
redirect location http://10.8.0.3:8082/octopus 302 if { path_beg /octopus }
then on, on premise node (sees nodes on 10.8... as well as 192.168...) I have usual acl setup:
acl host_octopus_pix path_beg -i /octopus
use_backend octopus_pix if host_octopus_pix
backend octopus_pix
server octopus 192.168.1.11:80
the octopus app is running on port 80 on 192.168.1.11
I guess haproxy can behave any way you configure it to. Your question is related more as of whether that would work for your users on your network.
You did not mention where your clients are coming from. The request received by haproxy is not forwarded to the on-premise haproxy. Instead, the linode haproxy returns a 302 to the client, and the client is supposed to connect to the on-premise haproxy directly.
Only you will know or can try whether that setup will work. In case it does not, you could still configure your haproxy to proxy-forward the request to the on-premise haproxy instead of sending a redirect.