Skip to content

auth_request to return other errors than 401 and 403 #941

@keul

Description

@keul

Describe the feature you'd like to add to nginx

From the official NGINX auth_request at https://nginx.org/en/docs/http/ngx_http_auth_request_module.html#auth_request we read that If it returns 401 or 403, the access is denied with the corresponding error code. Any other response code returned by the subrequest is considered an error.

What we'd like to obtain is:

  • to expand the number of 4xx errors returned by this endpoint (like 429), or…
  • to make the list of errors configurable, in a similar way like proxy_cache_valid works

Describe the problem this feature solves

We use NGINX and the auth_request in many situations where custom rate limits (not related to HTTP traffic) are a need. The current implementation returns to users only 401 or 403 errors.

So, when our auth_request subrequest returns something like an HTTP 429, the error for the user is a simple http 500.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions