Out of the blue I'm getting ERR_CONNECTION_REFUSED when I try to reach my site

Posted September 1, 2016 5.4k views
NginxUbuntuServer OptimizationConfiguration Management

Hi guys,

I have nginx running on my ubuntu 14.04 droplet, with one website at the moment. It was online and accessible until today, since I’m now getting a ERRCONNECTIONREFUSED when I type in the url. It doesn’t work on other devices/networks as well, but I can ping it…

Which lets me to believe there is suddenly something wrong with my configuration (although I haven’t changed anything lately). Within my /etc/nginx/sites-enabled/default file my settings are as followed:

server  {
       listen 80;
       rewrite ^ https://www.$server_name$request_uri? permanent;

server {
    listen 443 ssl;

    root /var/www/paulvanMotman;
    index index.html index.htm;

    location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ {
        expires 168h;

    ssl on;
    ssl_certificate /etc/nginx/ssl/ssl-bundle.crt;
    ssl_certificate_key /etc/nginx/ssl/server.key;

    location / {
        try_files $uri $uri/ =404;

If anyone could help me out I would greatly appreciate!

Kind regards,


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
2 answers

If your configuration worked before as expected, you made no changes, and now it does not function, this may not be the source of the issue.

It sounds like your web server process crashed. You should start out by checking your log files in /var/log/nginx/error.log to see what happened when the service stopped responding.

You can also attempt to restart the nginx service by running service nginx restart

if you can share any error messages you see in the logs or when attempting to restart the service here we’ll be happy to help you identify the issue.