+1 vote
in Operating Systems by (40.5k points)

When I start the Nginx server, I get the following warning message: "the "listen ... http2" directive is deprecated, use the "http2" directive instead". I am running Nginx sever on Debian 11 OS. How can I fix it?

1 Answer

+2 votes
by (351k points)
selected by
 
Best answer

I think you are using nginx >= 1.25.1, and hence, you are getting the warning message.

The fix is very simple. Open the Nginx configuration file mentioned in the warning message and make the following change:

From

listen      [IP]:443 ssl http2;

to

listen      [IP]:443 ssl;
http2 on;

Save the configuration file and restart the Nginx server using the following command:

systemctl restart nginx.service


...