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

I'm getting a 504 Bad gateway error when I try to browse to my site directly by entering the URL, however I can SSH into the publicly accessible machine by using the ip address and the url instead of the ip. On my android phone I see the bad gateway, and in chrome browser it simply says the :Oops! Google Chrome could not connect"

I'm trying to pin down why this happening, does anyone have any pointers or methods that I can use to figure out whats going on here? Never had this situation before.

Edit to add more info:

I'm running on Ubuntu 12.04.3 and Apache2 with a pretty much default configuration, with the addition of mod_evasive and mod_security. I have PHP 5 with suhosin and MySQL. Currently I't attempting to access an index.html and have no other files in there other than this. UFW is configured for port 80 and one for ssh, as well as 53 for DNS.

Also I'm not behind any kind of proxy.

share|improve this question
    
Oddly, enough I got it working by disabling and re-enabling all of my sites and restarting the apache2 service. I did try simply restarting the service many times before but that alone didn't work. Nothing in my logs indicating an hangup. –  Bob R Sep 3 '13 at 13:34

2 Answers 2

First find out where that 504 message is comming from. Apache doens't have that error page defined in its conf file by default (check it anyway to make sure) so I bet you are getting this error from some other intermediate system that acts as a manager for the http protocol, try to narrow that down first. If you are using a proxy in between the Internet and your web server that might be the cause.

share|improve this answer
    
As far as I know there is no intermediate system, just an ip from a block going into the server, unless it has something to do with the ISP. –  Bob R Sep 3 '13 at 11:01

Do a curl -I yourdomain.com and see what kind of HTTP server is responding to make sure it is your own apache2. If so try to disable the firewall and try to load the index page again.

share|improve this answer
    
Curl is fine now that I did what I commented under the main question, can you think of any reason I would have to do this? –  Bob R Sep 3 '13 at 13:35
    
Looks like your apache server was not aware of the network config and was issuing the 504, keep one eye on it just in case the error reproduces. Something that does work for me at the time of debugging this situations is elimitating variables, comment out virtual servers or even use an alternate simplified Apache2 conf file until you get it working. If you do it one by one (eliminating variables) you will get to the point where the guilty one shows her face. –  Daniel J. Sep 3 '13 at 15:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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