Ngnix on Ubuntu stops serving websites on replacing Ubuntu’s Ngnix with the mainline repository

I’m trying to upgrade my nginx install from nginx/1.24.0 (Ubuntu) to a more modern version to mitigate NGNIX2ROOT . I’ve attempted to upgrade to nginx/1.31.9 from the mainline repositories as per their instructions. Systemd service starts with no errors and there’s nothing interesting in the error logs

However I’m running several sites in with a reverse proxy and none of them work. Some of them are behind cloudflare and they give me 525 errors – something about a SSL handshake, and the ones behind letsencrypt and directly accessible time out.

When I run sudo nginx -t it is clean, but I get errors about missing [event] blocks and http blocks testing files in /etc/ngnix/sites-enabled.

Is there anything different between default ubuntu and ngnix installs that’s silently breaking my web server?