Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 184.73.195.180 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?

share|improve this question

migrated from stackoverflow.com Nov 29 '12 at 18:58

This question came from our site for professional and enthusiast programmers.

marked as duplicate by Ward, Scott Pack, John Gardeniers, Michael Hampton, Chris S Nov 30 '12 at 14:56

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
offtopic. not a programming problem. try serverfault. –  Marc B Nov 29 '12 at 16:15
    
Alright. Will do that. Thanks –  Himanshu Page Nov 29 '12 at 16:26

1 Answer 1

up vote 2 down vote accepted

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       184.73.195.180  # correct
www.doccaster.com.      1090    IN      A       198.187.31.244  # 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

share|improve this answer
    
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.