django-drf-boilerplate
django-drf-boilerplate copied to clipboard
Create a health check endpoint that ignores ALLOWED_HOSTS check
The default health check endpoint for load balancers normally is "/", which by default returns a 404, and it sends the request with an internal IP host, that is blocked by ALLOWED_HOSTS checking, returning a 403.
A suggestion is creating a "/health-check" endpoint that simply returns a 200 back and creating a middleware to ignore allowed host checking for this endpoint. Ideas?
I think that we can close this issue since Fred has already implemented it @CheesecakeLabs/backend
I am just not so sure about what @smaniotto is suggesting in "creating a middleware to ignore allowed host checking for this endpoint"
I think he means to not enforce the ALLOWED_HOSTS
check on the "/health-check" endpoint.
The suggestion is to implement it through a Middleware.