Last active
May 30, 2023 04:46
-
-
Save ismailyenigul/867132f298664156068b6e85847c0dfe to your computer and use it in GitHub Desktop.
docker labels for traefik reverse proxy multiple ports in a single container with different domain names
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--label "traefik.enable=true" \ | |
--label "traefik.protocol=http" \ | |
--label "traefik.first.port=80" \ | |
--label "traefik.first.frontend.rule=Host:web1.example.com" \ | |
--label "traefik.second.port=8080" \ | |
--label "traefik.second.frontend.rule=Host:web2.example.com" \ | |
Above labels will allow us to forward web1.example.com to docker container port 80 and web2.example.com to same container's port 8080 | |
Please note that this labels are valid for traefik v1. v2 has different labels |
Thank you very much Sir for saving my sunday night hacking plan !
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
traefik.yml
If you see on the dashboard a router Traefik did create itself.
ACME resolver by http (
traefik.yml
)