I have a Python Flask API hosted using AWS ElasticBeanstalk. The server works as expected but I noticed an error in the error.log
.
The error is:
connect() failed (111: Connection refused) while connecting to upstream, client: <my-ip-address>, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8000/"
The ElasticBeanstalk EC2 instance is in a public security group and allows access from anywhere. The API interacts with an AWS RDS MySQL
database which is in a private security group. Both services are under the same VPC.
Note: I am able to successfully connect to query the MySQL database from the ElasticBeanstalk server.
The RDS MySQL database has the following security groups attached:
default
- with an inbound rule allowing access from my IP address.
rds-ec2
- inbound rule: allows Rule to allow connections from ec2-rds
.
The ElasticBeanstalk EC2 instance has the following security groups attached:
ec2
- inbound and outbound rule: allow connections from anywhere on port 80.
ec2-rds
- outbound rule: Rule to allow connections to the RDS MySQL database from security group attached instances.
Does anyone know what the cause of this error is? I have done some digging and still am unsure. Should I be worried?
Any help would be greatly appreciated!