Possible Duplicate:
Can’t access EC2 hosted website

For some reason, I am unable to access our website www.doccaster.com (Bad request nginx). We are hosted on amazon EC2 with elastic ip associated to it. The weird part is

a) I can access it through the public dns url http://ec2-184-73-195-180.compute-1.amazonaws.com

b) My co founder who is located in another city can access it via www.doccaster.com.

I observed that my instance was failing reachability check, so I launched a new one and assigned it the the elastic ip. I tried to ping the ip address from my machine but no success. Any help will be really appreciated.

More details I ran the following command on my server

netstat -lntp | grep -E 'apache|httpd' and it displays

:::80 for httpd . Is this accurate ? Should it be 0:0:0:80 ? or doesnt matter?

  • offtopic. not a programming problem. try serverfault. – Marc B Nov 29 '12 at 16:15

I also get 400 Bad Request

# curl -I "http://www.doccaster.com"
HTTP/1.1 400 Bad Request
Server: nginx/1.0.15
Date: Thu, 29 Nov 2012 16:19:58 GMT
Content-Type: text/html
Connection: keep-alive
Content-Length: 166

You probably have an error in your nginx configuration for this specific domain. Could you please post it for a review?

I found the reason for both - why you can't and why your co-founder could access the website. You didn't set up www.doccaster.com for the correct IP address, while doccaster.com is.

doccaster.com.          1631    IN      A  # correct
www.doccaster.com.      1090    IN      A  # wrong

Your co-founder went to http://doccaster.com/ which is working.

Just fix your DNS settings for the domain

Note, that pinging EC2 instances is not possible by default. ICMP requests (ping sends a probe using ICMP protocol) are blocked by the security group

  • I am not using nginx at all. I am not sure why the request is being process by nginx . I am using apache. – Himanshu Page Nov 29 '12 at 16:25
  • also, good luck with this pretty cool idea – Michel Feldheim Nov 29 '12 at 16:52
  • Thanks Michel for all your help , I fixed it some time back and now its working. – Himanshu Page Nov 29 '12 at 18:21
  • you're welcome.. just hire me when you're bigger than facebook k? ;) – Michel Feldheim Nov 29 '12 at 19:15

Not the answer you're looking for? Browse other questions tagged or ask your own question.