Nginx isn't starting

I’m pretty sure it happened after updating Debian Buster and started compaining about “http2” being an “unknown directive”, which according to the official documentation. It’s aded at 1.25.1, but the system has 1.23.1 installed.

I’ve tried to compile the latest nginx but that just made HestiaCP not to load at all. Unless i restore the system’s version or stop the nginx service

Starting nginx - high performance web server…
: nginx: [emerg] unknown directive “http2” in /etc/nginx/conf.d/http2-directive.conf:1
nginx.service: Control process exited, code=exited, status=1/FAILURE
nginx.service: Failed with result ‘exit-code’.
Failed to start nginx - high performance web server.

Hello @fabiosarts,

As you said, nginx version 1.23.1 (latest mainline version available for Debian buster) doesn’t support http2 directive so, just remove file /etc/nginx/conf.d/http2-directive.conf or edit it and comment line http2 on;

#http2 on;

Just enable the nginx repo again in /etc/apt/sources.list.d/

And run apt update && apt upgrade…

1 Like

sorry for the long time to answer, but the system is actually updated and the nginx repos is there.
Nginx service is running, but i afraid the Nginx config files could have been reset somehow

nginx -v

For the version?

Also what version are you currently on?

Buster is 10

root@ns3:~# nginx -v
nginx version: nginx/1.23.1

It gives me the 1.23.1 version i mentioned in the first post

And your OS?

Debian 10 (buster)

rm /etc/nginx/conf.d/http2-directive.conf

should solve the issue but why it is not updating to the last package…

it’s pretty much deleted and the service starts, it only responses from localhost, with the initial nginx message

According to updating to the last package…i already tried compiling nginx with http2 support (to keep the http directive intact), but didn’t fix the problem either.