We've recently changed our deployment strategy to use AWS auto scaling group.
One problem we have in production is with the newly created EC2s.
Our Application starts to return:
Invalid HTTP_HOST header:
<ip_address>. You may need to add <ip_address> to ALLOWED_HOSTS`
because these EC2s are not in the original Django ALLOWED_HOSTS.
It doesn't make sense for each newly created EC2 to have to redeploy; that contradicts the sense of "auto scale".
Also, we don't want to use wildcards or IP range for security reasons.
What can we do?