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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | adf3ad8ede739423f20202b747b1a5c78ea72b45747fc61bb1e8d61d494e81b8 |
|
MD5 | 0bb5e5908d69222ebdebe23a4efb5e1d |
|
BLAKE2b-256 | 9e39bb820d19114c14b6598ba8c84fbb6993a30afab6e4bdecb901994ef07d20 |
Hashes for django_ebhealthcheck-2.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ed2e7509ba365b0558436b1d61ae73eac0933491ba3bbc689e068d6fc00a106 |
|
MD5 | 11d54e5ab40b47c39e201ce2b2568334 |
|
BLAKE2b-256 | 94dabfa613074c4b2b21372e742b59835830916cf4048ff967e485614fc863cc |