Loading...

When you recently upgraded Nginx to version 1.25, you may have noticed that Nginx has changed the HTTP module. One significant change is the depreciation of additional HTTP2 parameters in the ?listen? directive. Instead, it is recommended that you use the ?http2? the new one. If you use HTTP2, this new deprecation will affect you.

When you have just upgraded Nginx to version 1.25, you might notice that Nginx has changed its HTTP module. One significant change is the deprecation of additional HTTP2 parameters in the "listen" directive. Instead, you are advised to use the new "http2" directive. If you use HTTP2, this new deprecation will affect you.

When your Nginx configuration still includes the old directive, you will receive a warning message like this:

nginx:[warn] the "listen http2" directive is deprecated, use the "http2" directive instead in /etc/nginx/sites-available/yourconfigurationfile.

What Does This Warning Mean?

This warning message alone won't disrupt your site. But it informs you to prepare for the future. Since this directive is no longer in use, future Nginx updates might completely remove the "listen" directive, which could potentially break your site.

How to Fix It in Advance

To avoid any issues, you need to adapt to the latest directive. Here's a simple guide showing the before and after changes for easy reference:

Before:

listen 443 ssl http2;
listen [::]:443 ssl http2;

After:

listen 443 ssl;
listen [::]:443 ssl;
http2 on;

That's it! You just need to declare "http2" and turn it on.

Andre Yulianto

Andre Yulianto

How puzzling all these changes are! I'm never sure what I'm going to turn into a tidy little room.