From 6caa1bcdd3e11daa46abcc5f3214fc7ea4ace4ce Mon Sep 17 00:00:00 2001 From: clydegale Date: Fri, 4 Aug 2023 13:59:56 +0200 Subject: [PATCH] "listen ... http2" directive is deprecated Using to `nginx 1.25.1` to check the config the following warnings are thrown: ``` /etc/nginx/conf.d # nginx -t 2023/08/04 13:53:03 [warn] 69#69: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /etc/nginx/conf.d/listen_ssl.active:1 nginx: [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead in /etc/nginx/conf.d/listen_ssl.active:1 2023/08/04 13:53:03 [warn] 69#69: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /etc/nginx/conf.d/listen_ssl.active:2 nginx: [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead in /etc/nginx/conf.d/listen_ssl.active:2 ``` This fix results in the following output, fixing the issue: ``` /etc/nginx/conf.d # nginx -t nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful ``` --- data/conf/nginx/templates/listen_ssl.template | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/data/conf/nginx/templates/listen_ssl.template b/data/conf/nginx/templates/listen_ssl.template index 93ec80c6..40c402d0 100644 --- a/data/conf/nginx/templates/listen_ssl.template +++ b/data/conf/nginx/templates/listen_ssl.template @@ -1,2 +1,3 @@ -listen ${HTTPS_PORT} ssl http2; -listen [::]:${HTTPS_PORT} ssl http2; +listen ${HTTPS_PORT} ssl; +listen [::]:${HTTPS_PORT} ssl; +http2 on;