According to the link below, you can remove the http2 part from the 'listen directive, then enable http2.
Change this:
listen 443 ssl http2;
To this:
listen 443 ssl;
http2 on;
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I got this issue on my server ( Laravel forge with DigitalOcean) and all my sites are down. i tried troubleshooting using "nginx -t" and i got this error: "the "listen ... http2" directive is deprecated, use the "http2" directive instead in /etc/nginx/sites-enabled/*"
i checked in some of my site nginx file on forge dashboard and the code block :
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
might be the issue and i haven’t found any solution
Please or to participate in this conversation.