Open JantsoP opened 1 year ago
So small(ish) update. I managed to get this somehow working. Originally the domains are protected by Cloudflare. But once I configured in NGINX to use IP instead of domain and added the cert given by authentik + disabled ssl verification on proxy_pass due self signed cert, it started working just fine. So could this be something possibly to do with Cloudflare?
EDIT: Forgot to mention that both domains use Cloudflare SSL certificates which I made in CF dashboard.
The procedure I have been needing to do is edit lines 41 and 59 each time to my servers IP address, similar to what you mentioned.
I too use CF and an CF SSL Cert. on the nginx side and none on the proxy_pass.
I also ran into this same problem on 2023.3.0. I worked around it by hard-coding my Authentik server's IP address to bypass Cloudflare. If your NGINX can talk directly to Authentik, you could use the LAN IP. In my case, it could not, so I used the public WAN IP of my Authentik server.
Here are the relevant changes;
location /outpost.goauthentik.io {
proxy_pass https://0.0.0.0/outpost.goauthentik.io;
# ensure the host of this vserver matches your external URL you've configured
# in authentik
proxy_set_header Host login.acme.com;
...
Possibly related: https://github.com/goauthentik/authentik/issues/4381 https://github.com/goauthentik/authentik/issues/3147
@BeryJu comment in https://github.com/goauthentik/authentik/issues/4496#issuecomment-1400898062 seems to relate to the root of this issue as well
in the instance web site on the providers page, on the setup section, my standalone nginx instructions renders with a FQDN host, so it set me down the wrong path initially.
this restriction does introduce a constraint against setting up authentik that only exposes its services behind a reverse proxy (therefore lacking access by IP only).
it's unclear what options you would have in those scenarios other than to punch a hole directly into authentik to guarantee it can be reached by IP as well as by FQDN.
are there any other workarounds to get FQDN working in proxy_pass
?
Unsure if this helps anyone setting NGINX up, however take a peek at my comment for a different issue for configuration?
https://github.com/goauthentik/authentik/issues/4381#issuecomment-1605195711
i just did it
location /outpost.goauthentik.io {
proxy_pass http://192.168.0.1:9003/outpost.goauthentik.io;
...
proxy_redirect http://192.168.0.1:9003 https://auth.domen.com;
}
Describe your question/ I will reopen issue #2594 due it has been closed for months now and there is no proper answer on how to fix it. I have ran to this exact same problem. Issue is that when running config provided by authentik + added my HTTP->HTTPS redirect and actual internal app which it needs to call after auth, I do get error 500 on browser, 502 in logs.
Relevant infos I am running NGINX as standalone and I have configured reverse proxy per Authentik documentation. Latest Authentik in use which Docker can provide on Hetzner VM.
domain1.tld - Authentik server running on different domain, domain2.tld - Domain which has the actual service running.
Authentik NGINX config:
Application config:
Logs NGINX error log
There is nothing on Authentik logs about this (that I can see), but I am more than happy to provide more logs if needed.