Django app to add an instance's public IP to ALLOWED_HOSTS for Elastic Beanstalk's health check system
Project description
django-ebhealthcheck
By default, Elastic Beanstalk's health check system uses the public IP of each
load balanced instance as the request's host header when making a request.
Unless added to ALLOWED_HOSTS
, this causes Django to return a 400 Bad Request
and a failed health check.
This app dynamically adds your instance's public IP address to Django's
ALLOWED_HOSTS
setting to permit health checks to succeed.
Note this only adds the host to settings - the health check system still
requires /
to return 200 OK
, unless configured differently in EB.
Version 2.0.0 and higher supports IMDSv2. If you are using v1 and cannot upgrade,
use version 1 of this library instead (pip install django-ebhealthcheck<2.0.0
).
Installation
Simply add ebhealthcheck.apps.EBHealthCheckConfig
to your INSTALLED_APPS
:
INSTALLED_APPS = [
...
'ebhealthcheck.apps.EBHealthCheckConfig',
...
]
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for django-ebhealthcheck-2.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c26489a9c6ef705ef8c53c11191faa94cb1ac5958ee66c503744913b0ec7f1a9 |
|
MD5 | a03ced8519a58762aa0f0d5e32db0f97 |
|
BLAKE2b-256 | 99daf9b0a4650fe61509d657776360ae5eb89ace0e4bf34523f30c6947d82088 |
Hashes for django_ebhealthcheck-2.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27bf81f199972291136ac3acc7ed726bf12f5f41dd5ec3a340603c2da9a4b6d2 |
|
MD5 | f2381a88d0fff074d19013c0ff02c83d |
|
BLAKE2b-256 | 470da28c61b5b246b356b59830162d5720c1892c692683989dad6bdf4b073744 |