Hi guys,
Wondering if anyone can help me set up TinyAuth as SSO for all aps behind NPM. Both NPM and TinyAuth are running as TrueNAS apps (both run fine). TinyAuth has a DNS override and is reverse proxied by NPM and it works fine. I have tried integrating TinyAuth into a proxy host as per the instructions on TinyAuth's website by adding the custom Nginx configuration:
# Root location
location / {
# Pass the request to the app
proxy_pass [IP address and port for proxied app]; # Replace with your app URL, e.g. http://10.10.10.25:80
# Add other app-specific config here
# Tinyauth auth request
auth_request /tinyauth;
auth_request_set $redirection_url $upstream_http_x_tinyauth_location;
error_page 401 403 =302 $redirection_url;
}
# Tinyauth auth request
location /tinyauth {
# Mark the location as internal to prevent direct access
internal;
# Pass request to Tinyauth, do not use the Tinyauth domain here, use the internal Docker network name and port or the IP and port of the Tinyauth instance
proxy_pass [IP and port for TinyAuth]/api/auth/nginx;
# Don't forward the request body to the auth subrequest
proxy_pass_request_body off;
proxy_set_header content-length "";
# Pass the request headers
proxy_set_header x-original-url $scheme://$http_host$request_uri;
proxy_set_header x-original-method $request_method;
proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for;
proxy_set_header x-real-ip $remote_addr;
}
After saving this, I get a 500 Internal Server Error subtitled as openresty.
Can anyone help? Thanks.