I’m trying to use a load balancer to redirect based on path to different apps. For example, I’d like example.com/app1 to forward to a stack or service called app1. The problem is the request path is being passed along with the forwarding request. So app1 hosted at 192.168.0.5 gets a request of 192.168.0.5/app1. From what I understand of HAProxy, I could do this in the config with reqrep
There is not currently a way to do this. We’re considering a way to let you add custom haproxy config in #1871.
What you describe can’t be the default configuration because it won’t work right if the application returns any absolute or root-relative links/CSS includes/other things, which is pretty common. So alternately you configure the application to know that it is running from the base url /app1 instead of /.
so instead of having to manually specify the subdomain to container mapping, is it possible to setup a global subdomain match to container name, and if such container exists and has this specific port open then serve content from it
Even better - there’s a great project on github by jwilder/nginx-proxy - it basically looks for any container that has
VIRTUAL_HOST=www.domain.com and optionally VIRTUAL_PORT=3333
if any container on the network exists with these environment varaibles - then it auto-magically updated nginx.conf to create virtual hosts with SSL support.
Is it possible to achieve similar behavior through Rancher or can this functionality be added?