HAProxy community

Redirecting to certain servers faills

i want to set up a reverse proxy to redirect calls on my dynamic dns depending on the path. So if it is “mydyndns.com/web1” it should redirect to server “web1” and so on. I have set three ACL, based on path_beg. But whenever I enter any of the mentioned paths like “mydyndns.com/portainer” on the web browser, I always get redirected to default_backend (whatever I set it to).

Any ideas how to solve this?

    maxconn 300

    log     global
    mode    http
    option  httplog
    option  dontlognull
    timeout connect 5000
    timeout client  50000
    timeout server  50000

frontend http-in
    bind *:80

    acl has_portainer path_sub -i /portainer/#/auth
    acl has_grafana path_sub /grafana/
    acl has_influx  path_sub /write/

    use_backend grafana_backend if has_grafana
    use_backend portainer_backend if has_portainer
    use_backend influxdb_backend if has_influx

    default_backend grafana_backend

backend grafana_backend
    server grafana_test check

backend portainer_backend
    server portainer check

backend influxdb_backend
   server influxdb check

I work with docker for all components

This ACL is wrong. the ‘#’ character in HTML is an anchor, some kind of a pointer in your HTML code that your browser uses to move to this part of the page. Modern apps use it to modify the display part only.
Just give a try to this ACL: acl has_portainer path_sub -i /portainer

Note that I would not use path_sub, but path_beg instead since your matching is at the BEGinning of the path.

thanks for the reply!
I tried changing to acl has_portainer path_beg -i /portainer but there is no visible effect. I always get redirected to the default backend.
Does it have to do with my docker setup? Do I have to define the backend server with the “docker ip” or with regular local IP that I use from within my local network?