Last active
December 27, 2024 21:28
-
-
Save paneq/0a3e0bf3a69314f3b283f1c703288d88 to your computer and use it in GitHub Desktop.
Revisions
-
paneq renamed this gist
Dec 27, 2024 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
paneq revised this gist
Dec 27, 2024 . 1 changed file with 12 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ services: traefik: image: "traefik:v3.2" container_name: "traefik" command: - "--configFile=/etc/traefik/traefik.toml" ports: - "80:80" - "8080:8080" volumes: - "/var/run/docker.sock:/var/run/docker.sock:ro" - "./traefik.toml:/etc/traefik/traefik.toml" -
paneq created this gist
Dec 27, 2024 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ curl -i 'http://localhost:80/foo' HTTP/1.1 404 Not Found Content-Type: text/plain; charset=utf-8 X-Content-Type-Options: nosniff Date: Fri, 27 Dec 2024 18:38:51 GMT Content-Length: 19 404 page not found This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ I configured Traefik via `/etc/traefik/traefik.toml` in `docker-compose.yml`, but all routes were giving me 404 Not Found results. The routing did not even work, nothing was forwarded to the right service. The culprit turned out to be that `providers` need to be configured. This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ [providers] [providers.file] filename = "/etc/traefik/traefik.toml" This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ [log] level = "DEBUG" [accessLog] [api] insecure = true dashboard = true [entryPoints] [entryPoints.web] address = ":80" [http] [http.routers] [http.routers.todo] rule = "PathPrefix(`/`)" service = "todo" entryPoints = ["web"] [http.services.todo.loadBalancer] [[http.services.todo.loadBalancer.servers]] url = "http://host.docker.internal:4000" [providers] # 404 not found - solution [providers.file] filename = "/etc/traefik/traefik.toml"