goauthentik / goauthentik/authentik

Probable misconfig with Traefik (or Authentik stability issue?)

Open
#6,795 0 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
Python
Stars
25.6k
Forks
2k
Avg merge
1d 1h
Merged PRs (30d)
644

Description

Many thanks for that great piece of software!

**Describe your question/**
1/ Trying to setup behind Traefik: it works but constantly comes back to the login screen
Has someone a working Authentik behind Traefik config to share, please? (at a point it worked so that I setup a few apps and providers but after a few hours running it systematically shows this strange behaviour of coming back to login screen)

2/ (removed the second issue related to the database as it is doesn't happen anymore, not sure why but that's good news)

**Relevant infos**
Version: latest

Here's my docker compose using Traefik:

```
version: "3.4"

services:
postgresql:
image: docker.io/library/postgres:12-alpine
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"]
start_period: 20s
interval: 30s
retries: 5
timeout: 5s
volumes:
- database-authentik:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: ${PG_PASS}
POSTGRES_USER: ${PG_USER}
POSTGRES_DB: ${PG_DB}
env_file:
- stack.env
networks:
- traefik_proxy

redis:
image: docker.io/library/redis:alpine
command: --save 60 1 --loglevel warning
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "redis-cli ping | grep PONG"]
start_period: 20s
interval: 30s
retries: 5
timeout: 3s
volumes:
- redis-authentik:/data
networks:
- traefik_proxy

server:
image: ${AUTHENTIK_IMAGE:-ghcr.io/goauthentik/server}:${AUTHENTIK_TAG:-2023.8}
restart: unless-stopped
command: server
environment:
AUTHENTIK_REDIS__HOST: redis
AUTHENTIK_POSTGRESQL__HOST: ${AUTHENTIK_POSTGRESQL__HOST}
AUTHENTIK_POSTGRESQL__USER: ${PG_USER}
AUTHENTIK_POSTGRESQL__NAME: ${PG_DB}
AUTHENTIK_POSTGRESQL__PASSWORD: ${PG_PASS}
UID: 1000
GID: 100
volumes:
- /Tech/Authentik/media:/media
- /Tech/Authentik/custom-templates:/templates
env_file:
- stack.env
ports:
- "9200:9200"
- "9443:9443"
labels:
traefik.enable: true
## HTTP Routers
traefik.http.routers.authentik.rule: Host(`auth.DOMAIN`)
traefik.http.routers.authentik.entryPoints: https
traefik.http.routers.authentik.tls: true
traefik.http.routers.authentik.tls.certresolver: le
traefik.http.routers.authentik-outpost.rule: HostRegexp(`{subdomain:[a-z0-9-]+}.DOMAIN`) && PathPrefix(`/outpost.goauthentik.io/`)
traefik.http.routers.authentik-outpost.entryPoints: https
traefik.http.routers.authentik-outpost.tls: true
traefik.http.routers.authentik-outpost.tls.certresolver: le
traefik.http.routers.authentik.service: authentik-svc
traefik.http.services.authentik-svc.loadBalancer.server.port: 9200
traefik.http.middlewares.authentik.forwardauth.address: https://auth.DOMAIN/outpost.goauthentik.io/auth/traefik
traefik.http.middlewares.authentik.forwardauth.trustForwardHeader: true
traefik.http.middlewares.authentik.forwardauth.authResponseHeaders: X-authentik-username,X-authentik-groups,X-authentik-email,X-authentik-name,X-authentik-uid,X-authentik-jwt,X-authentik-meta-jwks,X-authentik-meta-outpost,X-authentik-meta-provider,X-authentik-meta-app,X-authentik-meta-version
diun.enable: true
depends_on:
- postgresql
- redis
networks:
- traefik_proxy

worker:
image: ${AUTHENTIK_IMAGE:-ghcr.io/goauthentik/server}:${AUTHENTIK_TAG:-2023.8}
restart: unless-stopped
command: worker
environment:
AUTHENTIK_REDIS__HOST: redis
AUTHENTIK_POSTGRESQL__HOST: postgresql
AUTHENTIK_POSTGRESQL__USER: ${PG_USER}
AUTHENTIK_POSTGRESQL__NAME: ${PG_DB}
AUTHENTIK_POSTGRESQL__PASSWORD: ${PG_PASS}
UID: 1000
GID: 100
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /Tech/Authentik/media:/media
- /Tech/Authentik/certs:/certs
- /Tech/Authentik/custom-templates:/templates
env_file:
- stack.env
depends_on:
- postgresql
- redis
networks:
- traefik_proxy

volumes:
database-authentik:
driver: local
redis-authentik:
driver: local

networks:
traefik_proxy:
external: true
name: traefik_proxy
```

**Logs**
Will try post later some specific error message

**Version and Deployment (please complete the following information):**
- authentik version: 2023.8.2
- Deployment: docker-compose

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.