Manually updated Bookworm; Pihole Nginx is returning 502

A similar issue to this:
https://discourse.pi-hole.net/t/nginx-returns-502-bad-gateway/32546

From what I’ve read, it might be an issue with TLS.
How would I return back to using TLS 1.2 instead of 1.3, which apparently is what pihole currently uses?

(For further context, I am running Dietpi x86)

Usually there is no SSL active by default. It would require certificates created by the user. Did you activate SSL? Can you share some web server logs? Or do you configure a revers proxy?

Hi again @Joulinar thanks for getting back so fast.

What’s the best way to serve you some logs?

I installed pihole and unbound as per the dietpi installer script, in the previous version of dietpi before upgrading. I haven’t added any SSL or configured a reverse proxy.

While checking some logs using dietpi-services, I did notice this failure with lighttpd
Would it have anything to do with the nginx 505?

yes, maybe.
Can you show journalctl -u lighttpd.service

Hi Jappe,

here’s the output for journalctl -u lighttpd.service

root@MMServer03:~# journalctl -u lighttpd.service
Jul 12 18:11:18 MMServer03 systemd[1]: Starting lighttpd.service - Lighttpd Daemon...
Jul 12 18:11:19 MMServer03 systemd[1]: Started lighttpd.service - Lighttpd Daemon.
Jul 12 18:11:19 MMServer03 lighttpd[646]: 2023-07-12 18:11:19: (network.c.537) can't bind to socket: [::]:80: Address already in use
Jul 12 18:11:19 MMServer03 systemd[1]: lighttpd.service: Main process exited, code=exited, status=255/EXCEPTION
Jul 12 18:11:19 MMServer03 systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Jul 12 18:11:19 MMServer03 systemd[1]: lighttpd.service: Scheduled restart job, restart counter is at 1.
Jul 12 18:11:19 MMServer03 systemd[1]: Stopped lighttpd.service - Lighttpd Daemon.
Jul 12 18:11:19 MMServer03 systemd[1]: Starting lighttpd.service - Lighttpd Daemon...
Jul 12 18:11:19 MMServer03 systemd[1]: Started lighttpd.service - Lighttpd Daemon.
Jul 12 18:11:19 MMServer03 lighttpd[745]: 2023-07-12 18:11:19: (network.c.537) can't bind to socket: [::]:80: Address already in use
Jul 12 18:11:19 MMServer03 systemd[1]: lighttpd.service: Main process exited, code=exited, status=255/EXCEPTION
Jul 12 18:11:19 MMServer03 systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Jul 12 18:11:20 MMServer03 systemd[1]: lighttpd.service: Scheduled restart job, restart counter is at 2.
Jul 12 18:11:20 MMServer03 systemd[1]: Stopped lighttpd.service - Lighttpd Daemon.
Jul 12 18:11:20 MMServer03 systemd[1]: Starting lighttpd.service - Lighttpd Daemon...
Jul 12 18:11:20 MMServer03 systemd[1]: Started lighttpd.service - Lighttpd Daemon.
Jul 12 18:11:20 MMServer03 lighttpd[757]: 2023-07-12 18:11:20: (network.c.537) can't bind to socket: [::]:80: Address already in use
Jul 12 18:11:20 MMServer03 systemd[1]: lighttpd.service: Main process exited, code=exited, status=255/EXCEPTION
Jul 12 18:11:20 MMServer03 systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Jul 12 18:11:20 MMServer03 systemd[1]: lighttpd.service: Scheduled restart job, restart counter is at 3.
Jul 12 18:11:20 MMServer03 systemd[1]: Stopped lighttpd.service - Lighttpd Daemon.
Jul 12 18:11:20 MMServer03 systemd[1]: Starting lighttpd.service - Lighttpd Daemon...
Jul 12 18:11:20 MMServer03 systemd[1]: Started lighttpd.service - Lighttpd Daemon.
Jul 12 18:11:21 MMServer03 lighttpd[773]: 2023-07-12 18:11:20: (network.c.537) can't bind to socket: [::]:80: Address already in use
Jul 12 18:11:21 MMServer03 systemd[1]: lighttpd.service: Main process exited, code=exited, status=255/EXCEPTION
Jul 12 18:11:21 MMServer03 systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Jul 12 18:11:21 MMServer03 systemd[1]: lighttpd.service: Scheduled restart job, restart counter is at 4.
Jul 12 18:11:21 MMServer03 systemd[1]: Stopped lighttpd.service - Lighttpd Daemon.
Jul 12 18:11:21 MMServer03 systemd[1]: Starting lighttpd.service - Lighttpd Daemon...
Jul 12 18:11:21 MMServer03 systemd[1]: Started lighttpd.service - Lighttpd Daemon.
Jul 12 18:11:21 MMServer03 lighttpd[795]: 2023-07-12 18:11:21: (network.c.537) can't bind to socket: [::]:80: Address already in use
Jul 12 18:11:21 MMServer03 systemd[1]: lighttpd.service: Main process exited, code=exited, status=255/EXCEPTION
Jul 12 18:11:21 MMServer03 systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Jul 12 18:11:22 MMServer03 systemd[1]: lighttpd.service: Scheduled restart job, restart counter is at 5.
Jul 12 18:11:22 MMServer03 systemd[1]: Stopped lighttpd.service - Lighttpd Daemon.
Jul 12 18:11:22 MMServer03 systemd[1]: lighttpd.service: Start request repeated too quickly.
Jul 12 18:11:22 MMServer03 systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Jul 12 18:11:22 MMServer03 systemd[1]: Failed to start lighttpd.service - Lighttpd Daemon.

Why did you install 2 web servers at the same time? Of course, that cannot work. Please test the following once

systemctl stop nginx
systemctl restart lighttpd

How odd and interesting. Truly, that would create issues!
But at no point did I knowingly or manually install both. I wonder if at some point i installed a package outside of dietpi-software that included nginx, but I wouldn’t know what that could be!
Thanks again for the help. that did work.
Shall I uninstall nginx? Seems like it’s useless…

Let’s check what has been installed via our script

dietpi-software list | grep " =2

But isn’t this the socket address for IPv6? Do you use IPv6?

Doesn’t matter, port 80 was blocked preventing web server start. By default, web server will try to listen on both IPv4/6 if available