Skip to content

[FEATURE] X-Tinyauth-Location/Location header on 401 nginx auth_request responses #773

@Zoey2936

Description

@Zoey2936

Is your feature request related to a problem? Please describe.
When configuring nginx to use auth_request with nginx the tinyauth domain needs to be hardcoded in the return 302 redirect location. authelia does this differently: while it violates standards they send a Location redirect as part of the 401 response to nginx. This allows nginx to pass it back to the client, this simplifies the required nginx config:

auth_request_set $redirection_url $upstream_http_location;
error_page 401 =302 $redirection_url;

Describe the solution you'd like
pass a Location or a X-Tinyauth-Location header as part of the 401 auth_request reponse which then can be used to redirect the client.

Describe alternatives you've considered
keep everything like it is now or redircet the client to the nginx tinyauth location which then further redirects it to tinyauth (like done by authentik/oauth2proxy)

Additional context
ZoeyVid/NPMplus#3046 (comment)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions