Adding a custom Traefik reverse proxy (immich-proxy don't reach other immich containers)
Hello. I'm about to deploy Immich but i can't decide if i should completely replace the default Immich's reverse proxy or add another one (Traefik). I think it is more secure to add another one as the default one is properly configured out of the box and i would save myself some troubleshooting.
My setup:
- Traefik reverse proxy -> CrowdSec -> (Optional; Will definitely implement over time) Keycloak (Authentication via "Login with Google") -> Service (Immich)
Experiences:
- Already hosting 2 services on local domain and 1 service publicly via Traefik.
- Didn't mess with headers yet so there would be some troubleshooting for sure.
What do you suggest me as reverse proxy setup?
13 Replies
I would keep immich_proxy, that way you don't have to worry about recreating its config
Yup, i thought the same. So theoretically, if i add labels to immich-proxy container section inside the docker-compose file like this:
It should work correctly?
I don't know traefik at all, but probably? :p
we'll see, lol. In case of trouble, should i create new topic or just write inside this one?
If it's reverse proxy trouble, this one is fine
So, i deployed Immich (worked nicely) and then i did some casual edits to work with traefik reverse proxy. See
docker-compose.yml
to see changes over original yml file.
.env file:
And now i'm getting errors in immich-proxy container:
The weird thing is that the "proxy" network doesn't contain the immich-proxy container:

if i open
immich.local.redacted.eu
it will write 404 page not found
and in traefik logs is basically the same
that's really weird. I just take a look into the docker compose file again and portainer / docker is somehow adding new line between
networks:
and -proxy
shown in the image:
Even if i stop the stack, remove the line and update the stack, it automatically throws the empty line back
.
.
.
.
.
.
.
.
.
.
SOLVED
I just needed to add every container in docker-compose.yml to it's netwrok (i called it
immich
) so instead of every container being in immich-default
network generated automatically, it lives in defined network immich
so the immich-proxy can reach every container and is in the proxy
network as well.
In case of someone having the same issue and don't know what to do, just mention me or write me a DM and i will help. Thank you @bo0tzz for guiding me and lettimg me fix my issue by myself. I learnt more this way and now it works perfectly!Btw, you can use this plugin in Traefik, so that you don't need to have a separate bouncer for Crowdsec. It also have support for Redis caching 👌
https://plugins.traefik.io/plugins/6335346ca4caa9ddeffda116/crowdsec-bouncer-traefik-plugin
Crowdsec Bouncer Traefik Plugin
Middleware plugin which forwards the request IP to local Crowdsec agent, which can be used to allow/deny the request
Thank you!