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.