Services behind a reverse proxy with databases on a different docker network are not accessible

I have 2 bridge docker networks that i use on my server: a frontend network for services that are exposed behind a reverse proxy (i use traefik) and a backend network for databases. When i deploy a service with a database container and another container, i connect the database to the backend network and the other container to both networks. However, with this configuration, i get a Gateway Timeout error when i try to connect to the interface behind the reverse proxy. If i connect the database to the frontend network everything works fine. Here’s the docker compose i used for authentik: Authentik Docker Compose - Pastebin.com

Set the docker.network for Traefik to use on providers.docker or in labels.

It worked, thank you

@wamuuwasawaken: please mark @bluepuma77’s response as solution.