Traefik Server Authentication
Utilizing Traefik's auth-forward

Using the Organizr authorization API

Træfik v1

You can use Traefik's auth-forward feature to do the same.
Example docker-compose.yml block for Organizr:
1
services:
2
organizr:
3
image: organizr/organizr
4
environment:
5
- fpm=true
6
- branch=master
7
- TZ
8
- PUID=${USER_UID}
9
- PGID=${USER_GID}
10
labels:
11
- "traefik.enable=true"
12
- "traefik.organizr.frontend.rule=Host: www.your_domain.com"
13
- "traefik.organizr.port=80"
14
depends_on:
15
- traefik
Copied!
Example service that depends on user being authenticated to Organizr:
1
services:
2
nzbget:
3
image: linuxserver/nzbget
4
environment:
5
- TZ
6
- PUID=${USER_UID}
7
- PGID=${USER_GID}
8
labels:
9
- "traefik.enable=true"
10
- "traefik.frontend.rule=Host: nzbget.your_domain.com"
11
- "traefik.frontend.auth.forward.address=http://organizr/api/v2/auth/1"
12
- "traefik.port=6789"
13
depends_on:
14
- traefik
15
- organizr
Copied!

Træfik v2

Træfik changed how the tags work in v2.
Example docker-compose.yml block for Organizr:
1
services:
2
organizr:
3
image: organizr/organizr
4
environment:
5
- TZ
6
- PUID=${USER_UID}
7
- PGID=${USER_GID}
8
labels:
9
- "traefik.http.routers.organizr.rule=Host(`www.your_domain.com`)"
10
- "traefik.http.services.organizr.loadbalancer.server.port=80"
11
- "traefik.http.services.organizr.loadbalancer.server.scheme=http"
12
depends_on:
13
- traefik
Copied!
Example service that depends on user being authenticated to Organizr:
1
services:
2
nzbget:
3
image: linuxserver/nzbget
4
environment:
5
- TZ
6
- PUID=${USER_UID}
7
- PGID=${USER_GID}
8
labels:
9
- "traefik.http.routers.nzbget.service"
10
- "traefik.http.routers.nzbget.rule=Host(`nzbget.your_domain.com`)'
11
- "traefik.http.services.nzbget.loadbalancer.server.port=6789"
12
- "traefik.http.routers.nzbget.middlewares=auth"
13
- "traefik.http.middlewares.auth.forwardauth.address=http://organizr/api/v2/auth/1"
14
depends_on:
15
- traefik
16
- organizr
Copied!
Last modified 1mo ago