Add middleware for AWS ELB health check
This commit is contained in:
parent
05e1b01dd8
commit
ce91071993
8
geeksbot_web/config/middleware.py
Normal file
8
geeksbot_web/config/middleware.py
Normal file
@ -0,0 +1,8 @@
|
||||
from django.http import HttpResponse
|
||||
from django.utils.deprecation import MiddlewareMixin
|
||||
|
||||
|
||||
class AWSELBHealthCheckMiddleware(MiddlewareMixin):
|
||||
def process_request(self, request):
|
||||
if request.META("PATH_INFO") == '/hostcheck/':
|
||||
return HttpResponse("It's Alive!")
|
||||
@ -137,6 +137,7 @@ AUTH_PASSWORD_VALIDATORS = [
|
||||
# ------------------------------------------------------------------------------
|
||||
# https://docs.djangoproject.com/en/dev/ref/settings/#middleware
|
||||
MIDDLEWARE = [
|
||||
"config.middleware.AWSELBHealthCheckMiddleware",
|
||||
"django.middleware.security.SecurityMiddleware",
|
||||
"django.contrib.sessions.middleware.SessionMiddleware",
|
||||
"django.middleware.locale.LocaleMiddleware",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user