kirkaracha
kirkaracha

Reputation: 752

Request timeouts on DigitalOcean NGINX server blocks

I'm getting request timeouts when I try to access any of the domains on my droplet in a browser. New droplet at DigitalOcean with Ubuntu 18.04 following How To Set Up Nginx Server Blocks (Virtual Hosts) on Ubuntu 16.04 and How to install a LEMP stack on Ubuntu 18.04

All of the domains are set up in the Networking section for my droplet.

If I ping the domains from my Mac the domain names resolve to the correct IP address but the request times out. If I ping the domains when I'm logged in with SSH they work.

All of the domains have server blocks set up like this:

server {
    listen 80;
    listen [::]:80;

    root /var/www/congressbios.com/public;
    index index.html;

    server_name congressbios.com www.congressbios.com;

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

There is an index.html file in the public directory of each domain root.

Running sudo nginx -t shows success

I've restarted nginx

Upvotes: 2

Views: 3827

Answers (2)

James Scheller
James Scheller

Reputation: 245

Maybe your firewall? Try from a shell on the server...

sudo ufw status

...and make sure you've got port 80 open. You can find more information about configuring the firewall on an Ubuntu server at DigitalOcean here...

https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-with-ufw-on-ubuntu-16-04

Another option would be try to see if you can get the page locally. That will tell you at least if your nginx configuration is okay. Again from a shell open on the server...

curl 127.0.0.1

And FWIW from here, that domain resolves to an IP address that doesn't respond to pings or http requests...

$ ping congressbios.com
PING congressbios.com (138.68.62.22): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2

Upvotes: 1

num8er
num8er

Reputation: 19372

I've done telnet to Your server and also pinged got timeouts.

Try to open ports:

sudo ufw allow http
sudo ufw allow https
sudo ufw allow echo

Doing service scan with nmap confirmed that You've closed ports:

$ nmap -sV congressbios.com

Starting Nmap 7.60 ( https://nmap.org ) at 2018-05-31 02:21 EEST
Nmap scan report for congressbios.com (138.68.62.22)
Host is up (0.35s latency).
Not shown: 998 filtered ports
PORT    STATE  SERVICE VERSION
22/tcp  open   ssh     OpenSSH 7.6p1 Ubuntu 4 (Ubuntu Linux; protocol 2.0)
443/tcp closed https
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

and only ssh (22) is open:

$ telnet congressbios.com 22
Trying 138.68.62.22...
Connected to congressbios.com.
Escape character is '^]'.
SSH-2.0-OpenSSH_7.6p1 Ubuntu-4

Upvotes: 2

Related Questions