'Serving index.html displays "Internal Error: Missing Template ERR_CONNECT_FAIL" in browser

I'm trying to get my Node server up and running on Ubuntu 14.04. I followed a tutorial from DigitalOcean to set up nginx and server blocks to serve my content.

I have the server setup correctly, I believe because I can whois my-site.com and also ping my-site.com. when I visit the web address in the browser, however I get just this error that displays in the page: "Internal Error: Missing Template ERR_CONNECT_FAIL".

I thought that maybe I pointed the nginx server block to the incorrect path, because of of the "Missing Template", but it points to the right file. It is supposed to display a simple index.html file located in /var/www/my-site.com/html.

Here is my server block if this sheds some light on the error:

server {
        listen 80 default_server;
        listen [::]:80 default_server ipv6only=off;

        root /var/www/my-site.com/html;
        index index.html index.htm;

        # Make site accessible from http://localhost/
        server_name my-site.com www.my-site.com;

        location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                try_files $uri $uri/ =404;
                # Uncomment to enable naxsi on this location
                # include /etc/nginx/naxsi.rules
        }

}

This file is located in /etc/nginx/sites-available/my-site.com and I've copied it to the sites-enabled directory as well.

What am I missing here?



Solution 1:[1]

This is a pretty standard error message, and in fact as of this moment nodejs.org is displaying that exact same message. I believe it is generated by a reverse proxy: for example, https://searchcode.com/?q=ERR_CONNECT_FAIL shows that ERR_CONNECT_FAIL appears in the squid reverse proxy software. I couldn't find something similar a quick search through the nginx source code.

When I encountered this error message, I was deploying through the digitalocean one-click dokku app and I did not have a domain in /home/dokku/VHOST, so it was being assigned a random internal IP address. I accessed it using [domain]:[port]. Hope that gives you a clue.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1