Website not working (ssh & ping does work)

Posted April 25, 2018 18.7k views

Today I set up my site (via this tutorial). At first it was working, but now when I browse to my wesite it doesn’t work anymore.

However, I am able to connect to the IP address (or via the domain), and I can ping to it. Also I know that my node.js is running and so is my NginX, because when I curl at localhost:8080 via ssh I get the proper response.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
6 answers

Your backend server doesn’t seem to be sending any data. Try curl -I http://localhost:8080 or opening the same in a browser. If you need help then just ping me at shivanand at converticacommerce dot com

Are you certain that nginx is running? If you can ping, ssh and can see your site returned at port 8080 (Node’s process) but cannot load your site on the default ports 80/443 (Nginx process) I would recommend restarting nginx with:

service nginx restart

and checking your logs in /var/log/nginx/error.log to see if additional information about the issue was recorded there.

What does curl at localhost port 80 give? Any firewall? Selinux? When you say doesn’t work, what exactly happens? Times out? 404. These details will help troubleshooting.

  • 8080 and 80 give the same response (just a simple “hello world”). When visited through the browser it says (via chrome):

    This page isn’t working didn’t send any data.

You need

curl -I http://localhost:80

This will tell you the status with the http header. It’s totally fine if the server sends empty response. It’s the headers that matter and will help tell if the site is down or not.

  • Oh thanks. It gives me this:

    HTTP/1.1 200 OK
    Server: nginx/1.10.3 (Ubuntu)
    Date: Wed, 25 Apr 2018 18:40:25 GMT
    Content-Type: text/plain
    Transfer-Encoding: chunked
    Connection: keep-alive
    Hello World

aha. Works like a charm. Now can you do the same but use the actual IP or fqdn from your machine?

This verifies that the server is working fine. Now your app needs to send some actual data that the browser can render such as an html markup / xml / json etc.