[GH-ISSUE #2623] [Minor] HTTP/2 support is enabled in proxy_host even when the checkbox is off. #1823

Closed
opened 2026-02-26 07:32:36 +03:00 by kerem · 4 comments
Owner

Originally created by @Encephala on GitHub (Feb 22, 2023).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2623

Checklist

  • Have you pulled and found the error with jc21/nginx-proxy-manager:latest docker image?
    • Yes
  • Are you sure you're not using someone else's docker image?
    • Yes
  • Have you searched for similar issues (both open and closed)?
    • Yes

Describe the bug

When creating a proxy host with HTTP/2 support disabled, the listen-directive still looks as follows:
listen 443 ssl http2;

I tried to look through the source code, but in the _listen.conf file, but that does have the {% if http2_support %}-part. so I guess the variable http2_support isn't set properly. I don't quite understand where that variable is set or used in the code (in nginx.js?), so I can't submit a PR.

Nginx Proxy Manager Version

Version 2.9.19 (specifically, the Docker image that has tag 2).

To Reproduce
Steps to reproduce the behavior:

  1. Create a new proxy host
  2. Ensure HTTP/2 support is off
  3. Examine the file at /data/nginx/proxy_host/ and note how http2 is still present in the listen directive.

Expected behavior

http2 is not present in the directive.

Screenshots

Operating System

Ubuntu 22.04 LTS.

Additional context

Originally created by @Encephala on GitHub (Feb 22, 2023). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2623 **Checklist** - Have you pulled and found the error with `jc21/nginx-proxy-manager:latest` docker image? - Yes - Are you sure you're not using someone else's docker image? - Yes - Have you searched for similar issues (both open and closed)? - Yes **Describe the bug** <!-- A clear and concise description of what the bug is. --> When creating a proxy host with HTTP/2 support disabled, the `listen`-directive still looks as follows: listen 443 ssl http2; I tried to look through the source code, but in the [`_listen.conf`](https://github.com/NginxProxyManager/nginx-proxy-manager/blob/develop/backend/templates/_listen.conf) file, but that does have the `{% if http2_support %}`-part. so I guess the variable `http2_support` isn't set properly. I don't quite understand where that variable is set or used in the code (in [`nginx.js`](https://github.com/NginxProxyManager/nginx-proxy-manager/blob/develop/backend/internal/nginx.js)?), so I can't submit a PR. **Nginx Proxy Manager Version** <!-- What version of Nginx Proxy Manager is reported on the login page? --> Version 2.9.19 (specifically, the Docker image that has tag `2`). **To Reproduce** Steps to reproduce the behavior: 1. Create a new proxy host 2. Ensure HTTP/2 support is off 3. Examine the file at `/data/nginx/proxy_host/` and note how `http2` is still present in the `listen` directive. **Expected behavior** <!-- A clear and concise description of what you expected to happen. --> `http2` is not present in the directive. **Screenshots** <!-- If applicable, add screenshots to help explain your problem. --> **Operating System** <!-- Please specify if using a Rpi, Mac, orchestration tool or any other setups that might affect the reproduction of this error. --> Ubuntu 22.04 LTS. **Additional context** <!-- Add any other context about the problem here, docker version, browser version, logs if applicable to the problem. Too much info is better than too little. -->
kerem 2026-02-26 07:32:36 +03:00
  • closed this issue
  • added the
    stale
    bug
    labels
Author
Owner

@Pcject commented on GitHub (May 8, 2023):

Just replace /app/templates/_listen.conf by :
listen 80;
{% if ipv6 -%}
listen [::]:80;
{% else -%}
#listen [::]:80;
{% endif %}
{% if certificate -%}
listen 443 ssl{% if http2_support == 1 or http2_support == true %} http2{% endif %};
{% if ipv6 -%}
listen [::]:443 ssl{% if http2_support == 1 or http2_support == true %} http2{% endif %};
{% else -%}
#listen [::]:443;
{% endif %}
{% endif %}
server_name {{ domain_names | join: " " }};

<!-- gh-comment-id:1537699315 --> @Pcject commented on GitHub (May 8, 2023): Just replace `/app/templates/_listen.conf` by : listen 80; {% if ipv6 -%} listen [::]:80; {% else -%} #listen [::]:80; {% endif %} {% if certificate -%} listen 443 ssl{% if http2_support == 1 or http2_support == true %} http2{% endif %}; {% if ipv6 -%} listen [::]:443 ssl{% if http2_support == 1 or http2_support == true %} http2{% endif %}; {% else -%} #listen [::]:443; {% endif %} {% endif %} server_name {{ domain_names | join: " " }};
Author
Owner

@Encephala commented on GitHub (May 9, 2023):

Looks good (but I haven't tested it), thanks for figuring it out :)

<!-- gh-comment-id:1539891197 --> @Encephala commented on GitHub (May 9, 2023): Looks good (but I haven't tested it), thanks for figuring it out :)
Author
Owner

@github-actions[bot] commented on GitHub (Jan 27, 2024):

Issue is now considered stale. If you want to keep it open, please comment 👍

<!-- gh-comment-id:1912907995 --> @github-actions[bot] commented on GitHub (Jan 27, 2024): Issue is now considered stale. If you want to keep it open, please comment :+1:
Author
Owner

@Encephala commented on GitHub (May 3, 2024):

This has been fixed in #3377

<!-- gh-comment-id:2093310786 --> @Encephala commented on GitHub (May 3, 2024): This has been fixed in #3377
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-proxy-manager-NginxProxyManager#1823
No description provided.