2

I have Ubuntu server that I am serving Django project. But I can not browse anything. I get ERR_CONNECTION_REFUSED error on all browsers.

Server host, OS, and applications:

  • Digital Ocean Ubuntu 18.04 (LTS) x64
  • nginx version: nginx/1.14.0 (Ubuntu)
  • ufw 0.36

Here is my nginx and ufw configs:

$ systemctl status nginx

● nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled
   Active: active (running) since Thu 2021-03-25 11:31:11 UTC; 5h 21min ago
     Docs: man:nginx(8)  Main PID: 18638 (nginx)
    Tasks: 2 (limit: 1152)    CGroup: /system.slice/nginx.service
           ├─18638 nginx: master process /usr/sbin/nginx -g daemon on; master_pr
           └─18643 nginx: worker process

$ sudo ufw status

Nginx Full                 ALLOW       Anywhere                  
22/tcp                     ALLOW       Anywhere                  
Nginx HTTP                 ALLOW       Anywhere                  
80/tcp                     ALLOW       Anywhere                  
443/tcp                    ALLOW       Anywhere                  
21/tcp                     ALLOW       Anywhere                  
25/tcp                     ALLOW       Anywhere                  
Nginx Full (v6)            ALLOW       Anywhere (v6)             
22/tcp (v6)                ALLOW       Anywhere (v6)             
Nginx HTTP (v6)            ALLOW       Anywhere (v6)             
80/tcp (v6)                ALLOW       Anywhere (v6)             
443/tcp (v6)               ALLOW       Anywhere (v6)             
21/tcp (v6)                ALLOW       Anywhere (v6)             
25/tcp (v6)                ALLOW       Anywhere (v6)

nginx site-enabled config file

server {
   listen 80;
   server_name 188.166.117.124;

    location = /favicon.ico { access_log off; log_not_found off; }
    location /static/ {
        root /home/ahubelkis/personal_web_site/personal_web_site;
    }

    location /media/ {
        root /home/ahubelkis/personal_web_site/personal_web_site;
    }

    location / {
        include /etc/nginx/proxy_params;
        proxy_pass http://unix:/home/ahubelkis/personal_web_site/personal_web_site/personal_web_site.sock;
    }
}

$ sudo systemctl restart nginx

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

What is the problem of my configs.

1 Answer 1

0

A port scan of your IP (gleaned from your nginx config) states that the only port open on that host is 22.

Perhaps try temporarily disabling UFW with sudo ufw disable and then see if you can connect?

2
  • I've tried but nothing changed. Is it possible to problem is related about https (SSL) settings? Mar 25, 2021 at 20:17
  • If you disabled the firewall and still nothing changed, then it's not simply https settings - which, by the way, based on what you showed above, you aren't using. I would double-check your IP address and everything else before proceeding. Something is off.
    – Ackack
    Mar 25, 2021 at 21:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .