What does "loadbalancer.server.url" really mean?

Hi all,

I use traefik since one year and I understand pretty well how it works.

What I really do not understand is what does it really mean loadbalancer.server.url.

I setup several container with traefik settings described by labels. Here an example:

    traefik.enable: true
    traefik.http.routers.[service].entrypoints: websecure 
    traefik.http.routers.[service].rule: Host(`sub.example.com`)
    traefik.http.routers.[service].tls: true
    traefik.http.routers.[service].tls.certresolver: production
    # traefik.http.services.[service].loadbalancer.server.url: '192.168.32.13:80'
    traefik.http.services.[service].loadbalancer.server.port: 8090
    traefik.docker.network: traefik

In this example I understand that declaring server.port, I'm telling to traefik in with port of my container he should forward the traffic.

Now the questions about loadbalancer.server.url:

  • What it really means?
  • Is the server address an real ip address of my local network (yes, I setup a perfectly working home server with apis, webserver and so on)
  • Is the server address the address assign by docker in traefik internal network?

And now the big deals:

Ho can I forward specific domain traffic into a container that is used as VPN server?
My big deal is to forward the specific subdomain traffic (eg. test.example.com) to a device (peer) connected with the VPN server container.

I understand it's a complicated task. My first goal is to understand "loadbalancer.server.url" meaning.
Second goal is how to debug properly (or sniff, or have logs) of the traffic related to a domain.
Third goal, if someone has knowledge to my big deal problem, well... you're awesome!

Dynamic config on containers via labels always has the container itself as target.

loadbalancer.servers.url is used in dynamic config file to indicate the target URL/IP (doc).

Today it can actually not be used in Docker labels, it needs to be in an extra file. You can support the issue by adding your like.

Ok now i understand better.

So, accordingly on what you wrote, server.url what represent?
Container IP in traefik network or LAN device ip?

It can be anything you can reach from within your Traefik container: domain, local IP, remote IP, even external IP.