- Newest
- Most votes
- Most comments
Hello.
Elastic Beanstalk environment's health status 'Severe [1]' means the health agent is reporting a very high number of request failures or other issues for an instance or environment.
According to the message you share, your application seems not responding well (returning 4XX HTTP response code) to health check job from ELB.
Please check health check policy for your Elastic Beanstalk environment and confirm If your environment responds well to the health check process.
By default, path for health check process is '/health' and desirable response is '200'.
So you will need to check how your application responds to requests from '/health' path and modify If your application doesn't respond with '200' for the requests from the above path.
Reference: [1] Health colors and statuses - Severe (red)
Relevant content
- asked 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated a year ago
Hi! I was checking web.stdout.log and it kept coming saying Invalid HTTP_HOST header: '172.31.31.20'. You may need to add '172.31.31.20' to ALLOWED_HOSTS. So I added that to ALLOWED_HOSTS and then the health went from "severe" to "ok". I don't really know why that fixed the health, do you? When i checked the url "domain/health" I only got 404 error. I still think there is something wrong even though it says the health is ok. The web.stdout.log is displaying: Jan 22 04:31:25 ip-172-31-31-20 web[6877]: Bad Request: / Jan 22 04:43:45 ip-172-31-31-20 web[6877]: Invalid HTTP_HOST header: '13.49.254.128'. You may need to add '13.49.254.128' to ALLOWED_HOSTS. Jan 22 04:43:45 ip-172-31-31-20 web[6877]: Traceback (most recent call last): Jan 22 04:43:45 ip-172-31-31-20 web[6877]: File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/django/core/handlers/exception.py", line 55, in inner Jan 22 04:43:45 ip-172-31-31-20 web[6877]: response = get_response(request) Jan 22 04:43:45 ip-172-31-31-20 web[6877]: File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/django/utils/deprecation.py", line 133, in call Jan 22 04:43:45 ip-172-31-31-20 web[6877]: response = self.process_request(request) Jan 22 04:43:45 ip-172-31-31-20 web[6877]: File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/django/middleware/common.py", line 48, in process_request Jan 22 04:43:45 ip-172-31-31-20 web[6877]: host = request.get_host() Jan 22 04:43:45 ip-172-31-
This is because django application manages allowed list for 'ALLOWD_HOSTS' addresses in order to protect HTTP Host header attacks. But this logic will prevent ELB from checking your application's health status with each EC2 instance's private IP address, so you will need to allow its private IP address to each instance. You can add some logic to get private IP address by retrieving instance metadata and parse 'local-ipv4' data, then add the address to your application's allowed list.