Admin Panel not reachable, nginx down?

Today I updated my MiaB to version 0.06 and after the update I cannot reach ANY of the web-based services. I have a strong suspicion that nginx is down. Restarting doesn’t work neither does re-updating work. What can I do to diagnose?

I am not an expert in linux so when asking to post logs/imgs please elaborate what command to use.

Try:

sudo nginx -t

and let me know.

Result:

root@box:~# sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

That’s ok then. Restarting nginx should be possible:

sudo service nginx restart

Also try running the status checks from the command line:

cd mailinabox
sudo management/status_checks.py

Restarting seems to work, still cant reach the admin panel

root@box:~# sudo service nginx restart
 * Restarting nginx nginx                                                    [ OK ]
root@box:~# cd mailinabox
root@box:~/mailinabox# sudo management/status_checks.py

System
======
✓  SSH disallows password-based login.
✓  System software is up to date.
✓  administrator@box.mydomain.com exists as a mail alias [=> info@mydomain.com]
✓  The disk has 24.4 GB space remaining.

Network
=======
✓  Outbound mail (SMTP port 25) is not blocked.
✓  IP address is not blacklisted by zen.spamhaus.org.

box.mydomain.com
=================
✓  Nameserver glue records are correct at registrar. [ns1/ns2.box.mydomain.com => 999.999.999.999]
✓  Domain resolves to box's IP address. [box.mydomain.com => 999.999.999.999]
✓  Reverse DNS is set correctly at ISP. [999.999.999.999 => box.mydomain.com]
✓  The DANE TLSA record for incoming mail is correct (_25._tcp.box.mydomain.com).
✓  hostmaster@box.mydomain.com exists as a mail alias [=> administrator@box.mydomain.com]
✓  Domain's email is directed to this domain. [box.mydomain.com => 10 box.mydomain.com]
✓  postmaster@box.mydomain.com exists as a mail alias [=> administrator@box.mydomain.com]
✓  Domain is not blacklisted by dbl.spamhaus.org.

mydomain.com
=============
✓  DNSSEC 'DS' record is set correctly at registrar.
✓  Nameservers are set correctly at registrar. [ns1.box.mydomain.com; ns2.box.mydomain.com]
✓  Domain's email is directed to this domain. [mydomain.com => 10 box.mydomain.com]
✓  postmaster@mydomain.com exists as a mail alias [=> administrator@box.mydomain.com]
✓  Domain is not blacklisted by dbl.spamhaus.org.

All checks out it seems to me

Edit: btw. IP and mydomain were correct here, changed it for security reasons OFC

What happens when you try to reach the admin panel?

I have tried multiple ways all resulting in the same error:
Connection refused

Tried via 2 PC’s on different networks and also via a VPS in the same network. On the VPS I tried wget and got also connection refused.

What about wget from the box’s own command line?

Sounds like maybe it’s a firewall issue. On the box:

sudo ufw status | egrep "Status|80|443"

Result:

root@box:~# sudo ufw status | egrep "Status|80|443"
Status: active
80                         ALLOW       Anywhere
443                        ALLOW       Anywhere
80 (v6)                    ALLOW       Anywhere (v6)
443 (v6)                   ALLOW       Anywhere (v6)

And:

wget -O - http://127.0.0.1/admin

(run on the box)?

Once again:

root@box:~# wget -O - http://127.0.0.1/admin
--2015-01-11 15:19:05--  http://127.0.0.1/admin
Connecting to 127.0.0.1:80... failed: Connection refused.

This is very strange. nginx is running, but it is not listening for incoming connections? Let’s see if it’s really listening-

sudo netstat -lp -A inet

It perhaps is listening only on ipv6.

Result:

root@box:~# sudo netstat -lp -A inet
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address  State   PID/Program name
tcp        0      0 localhost:8952          *:*              LISTEN  1323/nsd
tcp        0      0 *:smtp                  *:*              LISTEN  11348/master
tcp        0      0 localhost:953           *:*              LISTEN  7391/named
tcp        0      0 localhost:8891          *:*              LISTEN  8027/opendkim
tcp        0      0 *:sieve                 *:*              LISTEN  11245/dovecot
tcp        0      0 *:imaps                 *:*              LISTEN  11245/dovecot
tcp        0      0 localhost:10023         *:*              LISTEN  1403/postgrey.pid -
tcp        0      0 localhost:10025         *:*              LISTEN  8278/perl
tcp        0      0 localhost:10026         *:*              LISTEN  11245/dovecot
tcp        0      0 *:submission            *:*              LISTEN  11348/master
tcp        0      0 localhost:11211         *:*              LISTEN  1435/memcached
tcp        0      0 localhost:10222         *:*              LISTEN  8995/python3
tcp        0      0 localhost:domain        *:*              LISTEN  7391/named
tcp        0      0 box.mydomain.nl:domain  *:*              LISTEN  1323/nsd
tcp        0      0 *:ssh                   *:*              LISTEN  1271/sshd
udp        0      0 localhost:11211         *:*                      1435/memcached
udp        0      0 localhost:domain        *:*                      7391/named
udp        0      0 box.mydomain.nl:domain  *:*                      1323/nsd
udp        0      0 10.133.233.194:ntp      *:*                      1934/ntpd
udp        0      0 box.mydomain.nl:ntp     *:*                      1934/ntpd
udp        0      0 localhost:ntp           *:*                      1934/ntpd
udp        0      0 *:ntp                   *:*                      1934/ntpd

If nginx is running, it’s not listening on HTTP or HTTPS. There might be an error in the logs (tail /var/log/syslog or tail /var/log/nginx/error.log immediately after running sudo service nginx restart).

Tried to find something related to nginx for over 20 times now, after restarting etc.
Nothing is even mentioned in the logs about anything while restarting nginx.

Nothing there to find :S

Well, I would recommend starting over on a new machine e.g. at Digital Ocean, where I know the image you get works OK. If you have mail on the existing machine, you can just copy over the /home/user-data directory.

Same exact problem… Using digital ocean…

1 Like

Weird… I haven’t been able to fix it yet and I have been too lazy to migrate my server. The mailserver is still running perfectly just the adminpanel that is down. I’ll wait for the next update and see if that fixes it.

I am btw also hosted @digitalocean

I have updated to version 0.07 and that changed nothing for me. I now have set up a new droplet with a fresh install. Moved my /home/user-date to the new droplet and it works like a charm again. I have not be able to find any clues why it failed.

I had same issue and found the cause, the nginx config file was missing the primary domain config section as I had messed up my custom DNS settings. I pasted the primary domain config section from the nginx config templates directory on github while putting my primary domain in place and was able to use the admin panel to remove the offending DNS entries. familiarity with nginx config files is required to apply this fix.

I flagged my topic as resolved: