Last active
May 14, 2020 07:30
-
-
Save NIXKnight/0c522eb108d3c4649f5a216d26b701e3 to your computer and use it in GitHub Desktop.
ELB HealthCheck with Django ALLOWED_HOSTS on EC2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
AWS_ELB_META_IPV4_URL = "http://169.254.169.254/latest/meta-data/local-ipv4" | |
ELB_HEALTHCHECK_HOSTNAME = requests.get(AWS_ELB_META_IPV4_URL, timeout=5).text | |
ALLOWED_HOSTS += [ELB_HEALTHCHECK_HOSTNAME] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment