-
Notifications
You must be signed in to change notification settings - Fork 275
fix(nginx): enable HTTP/2 support for SSL server block, from nginx 1.25.1 #186
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
Open
Honghe
wants to merge
1
commit into
mattermost:main
Choose a base branch
from
Honghe:patch-1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2
−3
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: mattermost/docker
Length of output: 102
🏁 Script executed:
Repository: mattermost/docker
Length of output: 1635
🏁 Script executed:
Repository: mattermost/docker
Length of output: 209
🏁 Script executed:
Repository: mattermost/docker
Length of output: 2497
🌐 Web query:
nginx 1.25 http2 directive changes deprecated listen http2💡 Result:
In nginx version 1.25.1 (released June 13, 2023), the "http2" parameter in the "listen" directive (e.g., "listen 443 ssl http2;") was deprecated. Instead, use the new "http2" directive (e.g., "http2 on;") at the server block level. This change enables HTTP/2 on a per-server basis and allows sharing HTTP/2 and HTTP/1.1 on the same port without warnings. Example old config: listen 443 ssl http2; listen [::]:443 ssl http2; Example new config: listen 443 ssl; listen [::]:443 ssl; http2 on; Using the old syntax triggers warnings like: "nginx: [warn] the 'listen ... http2' directive is deprecated, use the 'http2' directive instead". Official documentation confirms: - ngx_http_v2_module: "http2" directive introduced in 1.25.1, enables HTTP/2. - ngx_http_core_module listen: "http2" parameter deprecated, use "http2" directive instead. This deprecation started in 1.25.1, part of the 1.25.x stable series (1.25.0 introduced experimental HTTP/3). As of 2026, nginx 1.29.x is current, but the change remains relevant for configs on 1.25+.
Citations:
🌐 Web query:
nginx http2 on directive server block 1.25.1💡 Result:
In nginx version 1.25.1 and later, the "http2" directive enables HTTP/2 in the server block. Syntax: http2 on; or http2 off; Default: off. Context: http, server. This appeared in version 1.25.1. Example configuration in a server block: server { listen 443 ssl; listen [::]:443 ssl; # IPv6 http2 on; # SSL certificates and other config... } The previous method using "listen 443 ssl http2;" is deprecated starting from nginx 1.25.1, and using it triggers a warning: "nginx: [warn] the 'listen ... http2' directive is deprecated, use the 'http2' directive instead". HTTP/2 requires SSL/TLS and ALPN support in OpenSSL (1.0.2+). Server push support was removed in 1.25.1.
Citations:
Update listen directives to use the
http2directive instead of the deprecatedlisten ... http2parameter.Lines 28–29 use the deprecated
http2parameter in the listen directive. Since this repository requires nginx 1.25.1 or later (as specified in env.example), removehttp2from the listen directives and addhttp2 on;in the server block. This avoids deprecation warnings.Proposed fix
🤖 Prompt for AI Agents