Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nginx 1.25.1+ Listen … http2” directive is deprecated #73

Open
SIP-Online opened this issue Aug 25, 2024 · 10 comments
Open

Nginx 1.25.1+ Listen … http2” directive is deprecated #73

SIP-Online opened this issue Aug 25, 2024 · 10 comments

Comments

@SIP-Online
Copy link

Just updated a server which upgraded nginx to 1.25.1
Warnings received on restart.
nginx: [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead

This will not break anything immediately, but just as a heads-up the old format is

server {
    listen 192.168.1.3:443 ssl http2;

And the new format for nginx >= 1.25.1 is

server {
    listen 192.168.1.3:443 ssl;
    http2 on;
@iliajie
Copy link
Contributor

iliajie commented Aug 25, 2024

Hello,

Thanks for the heads up!

Nginx version 1.25.1 isn't available upstream yet. We will consider supporting it in the future though!

@SIP-Online
Copy link
Author

SIP-Online commented Aug 25, 2024

Thanks for this quick response ! 👍
I forgot to mention that I use the Sury repository: https://packages.sury.org/nginx/

EDIT :
I just saw that HTTP/3 is also available since this version: https://nginx.org/en/docs/http/ngx_http_v3_module.html
It is simply activated in the same way !

It would kill two birds with one stone to add this support. 😉

@jcameron
Copy link
Collaborator

So did Nginx 1.25.1 introduce this change?

@iliajie
Copy link
Contributor

iliajie commented Aug 25, 2024

Yes, HTTP/3 was introduced in Nginx 1.25.0.

@SIP-Online
Copy link
Author

I confirm, and even active with the new HTTP/2 activation method:
nginx -V

nginx version: nginx/1.26.2
built with OpenSSL 3.0.13 30 Jan 2024
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -ffile-prefix-map=/build/nginx-1.26.2=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Wdate-time -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-z,relro -Wl,-z,now -fPIC' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=stderr --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --modules-path=/usr/lib/nginx/modules --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-compat --with-debug --with-pcre-jit --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_v2_module --with-http_v3_module --with-http_dav_module --with-http_slice_module --with-threads --with-http_addition_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_secure_link_module --with-http_sub_module --with-mail_ssl_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-stream_realip_module --with-http_geoip_module=dynamic --with-http_image_filter_module=dynamic --with-http_perl_module=dynamic --with-http_xslt_module=dynamic --with-mail=dynamic --with-stream=dynamic --with-stream_geoip_module=dynamic

@jcameron
Copy link
Collaborator

What I was wondering is which version added support for the http2 directive..

@SIP-Online
Copy link
Author

This is from version 1.25.1 (paragraph: Deprecation of listen … http2 directive): https://www.f5.com/company/blog/nginx/nginx-plus-r30-released#Important-Changes-in-Behavior-

@willnode
Copy link
Contributor

willnode commented Sep 3, 2024

Hello, just heads up, it's giving warning already in NGINX 1.24, this version is available in Rocky Linux 9 (via stream modules).

https://serverfault.com/a/1131319/583113

One of solution is add http2 on; instead of adding http2 after listen directive. For myself I turned off http2 by default to remediate this warning.

@willnode
Copy link
Contributor

willnode commented Sep 3, 2024

@jcameron it's fairly new https://hg.nginx.org/nginx/rev/08ef02ad5c54 maybe need to detect nginx version?

@jcameron
Copy link
Collaborator

jcameron commented Sep 4, 2024

Yes, we'd need to add a check for the Nginx version.

I'm a little reluctant to implement this because it would make migration of Nginx configs between systems difficult..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants