Proxy to real host on another machine

Hi there,
i am very new to traefik and starting to do some testing with it.

I got some Docker Containers working with Traefik 2.2 and letsencrypt.
I have a real webserver on another (virtual) machine with its own IP Adress.

How can i proxy traffic, that is incoming on my traefik machine on port 443 with auto-generating letsencrypt certs (ssl termination) to a real machine with a running webserver on port 80.

Can you give me some hints how to do that.

thx
Wolfgang

Welcome @arndtw

You can use a file provider to create the router, service and middleware. And you can use your existing certificate resolver with the router.

I found that already, but have no idea how it has to look. There are a lot of fobars in the documentation https://docs.traefik.io/reference/dynamic-configuration/file/
That is a bit confusing for me.

I added that to my dynamic configuration

http:

Add the router

routers:
router0:
entryPoints:
- web
service: service-foo
rule: host(foo.bar.de)
tls:
cert-resolver: default

services:
service-foo:
loadBalancer:
servers:
- url: http://192.168.1.53/
passHostHeader: true

My goal ist that everything. to foo.bar bar is proxied to http://192.168.1.53

Thx Wolfgang

@arndtw Formatting aside this looks okay. I loaded into a traefik. :+1:

http:
  routers:
    router0:
      entryPoints:
      - web
      service: service-foo
      rule: host(`foo.bar.de`)
      tls:
        cert-resolver: default

  services:
    service-foo:
      loadBalancer:
        servers:
        - url: http://192.168.1.53/
        passHostHeader: true

One thing to check, is the entrypoint correct ?