Quantcast
Channel: HAProxy community - Latest topics
Viewing all articles
Browse latest Browse all 4714

How to redirect changing path in the backend

$
0
0

I have Portainer running at portainer_agent:9000 in my Swarm. I would like to access http://myserver.com/portainer to get portainer, but I can’t find how to accomplish that.
The “http-request set-path” I’m using at backend is almost working, but it’s not quite there yet.
So the question: How to get the path /portainer/anything redirected to /anything at the backend.

Here is my haproxy.conf snippet:

frontend http-in
    bind *:80
    
    acl is_portainer path_beg /portainer
    use_backend portainer if is_portainer

backend portainer
    balance leastconn
    mode http
    http-request set-path "%[path,regsub(^/portainer,/,)]" if { path_beg /portainer }
    server portainer portainer_agent:9000 resolvers docker_resolver resolve-prefer ipv4

Thank you.

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 4714

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>