Port to port forwarding by traefik

Hi all!

I'm newbie to traefik and I have a question about simple port forwarding from docker containers to the outside

I have a virtual machine named vm-docker.local

Inside the virtual machine there are 3 docker containers, each of which hangs on port :80

Can I configure the routing of a certain service to a certain external port using one traefik?

All I found is rule = "Host(vm-docker.local)", but I don't find it convenient.
Is there a similar configuration for binding ports rather than names?

thx all!

The usual Traefik flow:

Entrypoint: the listening port
Router: domain and path matching, middleware
Service: the target services, servers, port, scheme

So for listening on another port you need an additional entrypoint.

Thank you.

You write about matching domain

I don't want to map a service to a domain. I want to hard-bind a specific external port to a specific service.

Is it possible to do without matching domain?

You should be able to use a catch-all for http/s or TLS/SSL traffic:

rule: HostRegexp(`{host:.+}`)
rule: HostSNIRegexp(`{host:.+}`) # for TLS

If you service does not use http, you need to use a TCP router.