简体   繁体   中英

Traefik Allow Custom Domain

Using docker as backend and traefik as proxy, I'm using this label, under the service in docker-compose.yml

  • traefik.enable=true
  • traefik.frontend.rule=Host:sub.example.com
  • traefik.backend.port=80
  • traefik.docker.network=http_network

How to allow our user, to be able use their domain or subdomain by using CNAME redirect, such as

sub.usera.com CNAME sub.example.com

I already make my web app to handle the host redirect. But i can't get it work. It always resulting to "404 page not found", but the request never passed through our apps. The traefik log also resulting in 404 because it doesn't contain frontend rule of sub.usera.com. Does it mean, it not possible to serve a CNAME redirection using traefik?

将frontend.rule更改为traefik.frontend.rule=Host:sub.example.com,sub.usera.com

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM