Skip to content

Consider providing a middleware (or doc) to ensure the health check endpoint is always reachable #678

@scur-iolus

Description

@scur-iolus

At the moment, the documentation only suggests exposing the health check by adding a path in urls.py. One issue we have encountered is that the health check endpoint can sometimes become unreachable due to other middleware in the Django stack. For example, middleware that enforces authentication, redirects, rate limiting, maintenance modes, IP filtering, or other request-processing logic may inadvertently block access to the health check endpoint.

In production environments, this can be problematic because health check endpoints are often used by load balancers, container orchestrators, or monitoring systems. These systems typically expect the endpoint to be reliably accessible regardless of most application-level behavior.

Because of this, it might be helpful if django-health-check provided one of the following:

  • A built-in middleware that ensures the health check endpoint can bypass certain middleware behaviors (or is handled early in the request lifecycle),
  • Documentation explaining how to implement such middleware safely.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions