Consider providing a middleware (or doc) to ensure the health check endpoint is always reachable #679
Replies: 1 comment
-
|
Hi @scur-iolus, thanks again for reaching out. I understand where you are coming from. In fact, I opted for a view, to include the entire stack. I wouldn't really call your application health, if your router doesn't work. Following this logic we could implement an NGINX middleware. Wouldn't tell us much about your application, but your reverse proxy works fine. Thus, I would strongly advise against writing a Django middleware. We actually take a couple of measure to prevent Django or a proxy to mess things up: We prevent proxy caching (CDN), the command line tool can set X-Forwarded headers, and there is an option to bypass the HTTP stack. The latter again, is only recommend if you are not running HTTP, but use Django for protocols MQTT or WS only. All that being said, is there a concrete issue you are currently facing when adopting django-health-check? I am happy to assist you in stetting up a reliable health check. Cheers! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
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-checkprovided one of the following:Beta Was this translation helpful? Give feedback.
All reactions