0

I'd like to use traefik as reverse proxy. It should handle both "naked" and sub domain.

Consider this traefik.toml:

logLevel = "DEBUG"

defaultEntryPoints = ["http"]
[entryPoints]
  [entryPoints.http]
  address = ":80"

[file]

[frontends]
  [frontends.vz]
  backend = "vz"
    [frontends.vz.routes.raspi1]
    rule = "Host:volkszaehler.io"
#    [frontends.vz.routes.raspi2]
#    rule = "Host:vz.volkszaehler.io"

[backends]
  [backends.vz]
    [backends.vz.servers.raspi1]
    url = "http://server.fritz.box"

As soon as I have two routes (subdomain + naked), the access to neither the naked nor the subdomain works. If one route is removed the other works just fine.

How can I have both naked and subdomain forwarded?

andig
  • 171

1 Answers1

0

I know it's quite late answer, but in case anybody stumbles upon this. You are combining the rules with AND, so both rules need to be matched (and ofc you cant send request to both volkszaehler.io and vz.volkszaehler.io at the same time)

You want to use comma separator:

[frontends.vz.routes.raspi1]
rule = "Host:volkszaehler.io,vz.volkszaehler.io"

For more info see traefik docs

trabant
  • 16