seanpconkie
seanpconkie

Reputation: 71

Why is my EC2 instance is returning 400 error

I have deployed a Django website on AWS Elastic Beanstalk - the environment is green and website available via the url provided. However, I have set an application load balancer with the EC2 instance of the ELB application as the target group, and this is returning Bad Request (400). When trying to access the instance via the public DNS I get the same Bad Request (400).

I have checked the security groups and all required ports (80 for http, 443 for https and 22 for ssh) are open on the instances security group and the target groups security group.

I am unsure what else could be causing this as the django app is available and the instance has status running and I can ssh into it. Have checked the AWS docs and other similar questions on SO but can't find any possible solutions.

Upvotes: 0

Views: 2060

Answers (1)

seanpconkie
seanpconkie

Reputation: 71

So, the answer to this was 'check the logs' facepalm. Logs clearly showed there was a disallowed host error which was easily fixed. Credit to Iain Shelvington who reminded me to check the logs.

Upvotes: 1

Related Questions