Hello and greetings good folks,
I am just learning and trying out traefik for my selfhosting hobbies, and sadly I am running into problems with some routine. I am pretty sure, it's a stupid mistake from my end, but I would like to really know what I am doing wrong and can refocus my mental model about Traefik.
I have two services running inside docker on a raspberrypi, one is traefik
itself and the other one is a service called monica.
When I port forward monica's internal 80
port to let's say port 9999
of the host, I can reach the service on http://rpihome:9999
. No issues at all.
However, I would like to access the service at http://rpihome/monica
. To achieve this I have the following labels on monica's docker container:
"traefik.http.middlewares.monica-stripprefix.stripprefix.prefixes": "/monica",
"traefik.http.routers.monica.rule": "Path(`/monica`)"
"traefik.http.routers.monica.middlewares": "monica-stripprefix",
I have also tried changing the rule from Path
to PathPrefix
as well as Host() && PathPrefix()
without any luck.
I always get a 404 on http://rpihome/monica and my monica container logs indeed give me a log that there was a GET request for /monica
which was returned 404.
I didn't even knew that I had to link the middlewares to routers like this "traefik.http.routers.monica.middlewares": "monica-stripprefix",
, but was pointed out to this by a kind stranger on Discord.
Can someone shed a light on what's missing? Looking forward.
Regards,
Anubhav.