Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use traefik as reverse proxy for non-Docker service on second server

Tags:

traefik

I have a "server" setup running several services in containers where traefik is working just fine. I would like to add a virtual host for a service running on a seperate machine so that I can go to hassio.domain.com and be forwarded to that server. At one point I had the other service/machine running nginx and pointing to the main server, but I can't seem to figure out how to make traefik point to 10.0.0.xx:8123 statically while maintaining the already functioning bits on the main server.

Am I being dense? I'm definitely inexperienced, but I've spent hours googling and trying to find examples and I don't think I really understand the terminology.

Thanks

like image 482
Karl Wooster Avatar asked Sep 16 '25 05:09

Karl Wooster


1 Answers

did you get this figured out? If not, I may be able to help. I think I did what you are trying to do. I had traefik running in a docker container on a server with IP 10.10.1.12 and I wanted to forward to a raspberry pi running pi-hole at IP 10.10.1.254

here is an example of one such entry in my traefik.toml

you may not need the basic auth part

[file]

[backends]
  [backends.backend-pihole]
    [backends.backend-pihole.servers]
      [backends.backend-pihole.servers.server-pihole-ext]
        url = "http://10.10.1.254/admin/"
[frontends]
  [frontends.frontend-pihole]
  backend = "backend-pihole"
  passHostHeader = true
  basicAuth = [
  "username:password",
]
[frontends.frontend-pihole.routes]
  [frontends.frontend-pihole.routes.route-pihole-ext]
    rule = "Host:subdomain.domain.com"

hope this helps

like image 105
unruly1 Avatar answered Sep 19 '25 16:09

unruly1