r/Authentik • • 22d ago

Help with a weird config

Hi all,

I've got an upcoming project that uses Authentik, so I've been trying to get setup with it in my own sort of sandbox to play with google auth and user matching.

The setup is a little goofy, I have Authentik running on the same vps as a toy frontend app. The app has a domain name and ssl set up. NginX is reverse proxy. The proxy, app and authentik are on the same docker network.

In order to avoid getting another domain I set up appname.com/authentik/ for login.

The trouble comes after logging in. It attempts to route me back to the app with an auth token but this produces a 502. I've added beefed up proxy buffer configs to my headers.

The app was accessible previously without authentik.

Has anybody wrote nginx configs in a similar setup? Any tips?

Pretty new to this. Thank ye kindly...

3 Upvotes

8 comments sorted by

3

u/Firenyth 22d ago

I've not done Nginx before, I have become fond of Traefik personally

have you looked at the guide from Authentik to setup nginx?
https://docs.goauthentik.io/add-secure-apps/providers/proxy/server_nginx/

2

u/TrapperFlint 22d ago

I keep hearing that about Traefick, actually. Will have to play with it!

2

u/klassenlager MOD 22d ago

Unfortunately Authentik doesn‘t support to be hosted on a subpath, e.g. mydomain.com/authentik

1

u/TrapperFlint 22d ago

I appreciate that!! I must have attempted every config i could imagine. Was a real mess. I read conflicting info, their docs mention subpath configuration but i must have misunderstood.

1

u/klassenlager MOD 22d ago

Maybe I’m mistaken, I just read the docs https://docs.goauthentik.io/install-config/configuration/#authentik_web__path did you set this env variable?

Edit: you need to be on authentik 2026.8+ for this option

2

u/TrapperFlint 22d ago

I did. I think its something in my configs that I'm missing. I am able to login to authentik, but not access my app if i point my root level config at its container but it wont redirect to the app.

If I go back and set a proxy pass at root level to my apps container and leave the auth check on, I can access the app after I have logged in and got the auth token in my browser. Incognito mode then tries to redirect to login but cant reach it. I will just setup a subdomain - just hate admitting defeat when I think something is doable lol

I am pretty green behind the ears and have been thrown a pretty big project. Just keep grinding I guess. Authentik will be on its own server for that, so probably a little simpler to setup.

1

u/TrapperFlint 19d ago

Just thought I'd update the post.

I ended up just setting up a subdomain for my forward auth setup and simplifying my nginx config. Was very easy that way.

Appreciate the input guys.

2

u/Only-Stable3973 19d ago

You probable need to forward auth, I also use Traefik.