[GH-ISSUE #1264] Incorrect deprecation warning for listen ... http2 directive #696

Closed
opened 2026-02-26 12:09:11 +03:00 by kerem · 1 comment
Owner

Originally created by @iAHTOH on GitHub (Jul 27, 2025).
Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/1264

Describe the bug
nginx-ui shows an incorrect deprecation warning when using the officially supported listen ... http2 directive in the nginx config:

nginx: [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead

This is misleading and wrong — http2 is only valid inside the listen directive, not as a standalone directive.


To Reproduce
Steps to reproduce the behavior:

  1. Add the following to your nginx site config:
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    
  2. Reload or validate config through nginx-ui.
  3. See the warning appear in the output.

Expected behavior
No warning should appear.
This usage is correct per the official NGINX documentation:
👉 https://nginx.org/en/docs/http/ngx_http_core_module.html#listen

Using http2 outside the listen block results in a fatal error:

nginx: [emerg] invalid number of arguments in "http2" directive

Screenshots
Not applicable


Info (please complete the following information):

  • nginx-ui version: [e.g. 1.24.3]
  • NGINX version: [e.g. 1.24.0 or 1.25.x]
  • Server OS: [e.g. Debian 6.12.33+deb12-amd64]

Additional context
Please update the validation logic in nginx-ui to:

  • Recognize that http2 is only valid as part of the listen directive.
  • Remove or revise the incorrect deprecation warning.

Thanks for maintaining this project!

  • Server Arch: [e.g. x86, aach64]
  • Nginx UI Version: [e.g. 1.8.0]
  • Your Browser: [e.g. Chrome, Safari, Firefox]

Additional context
Add any other context about the problem here.

Originally created by @iAHTOH on GitHub (Jul 27, 2025). Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/1264 **Describe the bug** `nginx-ui` shows an incorrect deprecation warning when using the officially supported `listen ... http2` directive in the nginx config: ``` nginx: [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead ``` This is misleading and wrong — `http2` is only valid **inside the `listen` directive**, not as a standalone directive. --- **To Reproduce** Steps to reproduce the behavior: 1. Add the following to your nginx site config: ```nginx listen 443 ssl http2; listen [::]:443 ssl http2; ``` 2. Reload or validate config through `nginx-ui`. 3. See the warning appear in the output. --- **Expected behavior** No warning should appear. This usage is correct per the official NGINX documentation: 👉 https://nginx.org/en/docs/http/ngx_http_core_module.html#listen Using `http2` outside the `listen` block results in a fatal error: ``` nginx: [emerg] invalid number of arguments in "http2" directive ``` --- **Screenshots** _Not applicable_ --- **Info (please complete the following information):** - **nginx-ui version**: [e.g. 1.24.3] - **NGINX version**: [e.g. 1.24.0 or 1.25.x] - **Server OS**: [e.g. Debian 6.12.33+deb12-amd64] --- **Additional context** Please update the validation logic in `nginx-ui` to: - Recognize that `http2` is only valid as part of the `listen` directive. - Remove or revise the incorrect deprecation warning. Thanks for maintaining this project! - Server Arch: [e.g. x86, aach64] - Nginx UI Version: [e.g. 1.8.0] - Your Browser: [e.g. Chrome, Safari, Firefox] **Additional context** Add any other context about the problem here.
kerem 2026-02-26 12:09:11 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@0xJacky commented on GitHub (Jul 27, 2025):

Hello, if you need to enable HTTP2, according to the documentation of Nginx, for Nginx UI versions 1.25.1 and above, please refer to the following format:

server {
    listen 443 ssl;
    server_name example.com;
    http2 on;
    // ... 
}

Reference: https://nginx.org/en/docs/http/ngx_http_v2_module.html#http2

<!-- gh-comment-id:3124479963 --> @0xJacky commented on GitHub (Jul 27, 2025): Hello, if you need to enable HTTP2, according to the documentation of Nginx, for Nginx UI versions 1.25.1 and above, please refer to the following format: ``` server { listen 443 ssl; server_name example.com; http2 on; // ... } ``` Reference: https://nginx.org/en/docs/http/ngx_http_v2_module.html#http2
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-ui#696
No description provided.