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

September 1, 2016 4k views
Nginx Server Optimization Configuration Management Ubuntu

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;
       server_name paulvanmotman.com www.paulvanmotman.com;
       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;

    server_name paulvanmotman.com www.paulvanmotman.com;
    location / {
        try_files $uri $uri/ =404;

If anyone could help me out I would greatly appreciate!

Kind regards,


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.

  • Hi thanks for thinking with me and your reply.. i actually just solved it myself! See my comment below! Thanks a lot

Have another answer? Share your knowledge.