[GH-ISSUE #5461] Reverse Proxy: Support for Upstream TLS configuration (SNI override and InsecureSkipVerify) #11506

Open
opened 2026-08-05 01:29:52 -04:00 by saavagebueno · 8 comments
Owner

Originally created by @Deniom3 on GitHub (Feb 26, 2026).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/5461

Description:
The Reverse Proxy feature consistently returns a 502 Bad Gateway error when the target service is configured via HTTPS (port 443). This occurs even when the internal service (e.g., a Traefik or Caddy instance) uses valid SSL certificates.

Current Constraints:

  • Proxying via port 80 (HTTP) to the internal server works correctly.
  • Proxying via port 443 (HTTPS) results in a 502 error.
  • Enabling "Pass Host Header" and "Rewrite Redirects" in the current NetBird UI does not resolve the underlying TLS handshake failure.

Comparison with Cloudflare Tunnel:
To support complex scenarios with internal proxies, similar tools like Cloudflare Tunnel provide specific TLS/HTTP settings that are currently missing in NetBird:

  1. Origin Server Name: Allows defining the hostname expected from the origin server certificate
  2. No TLS Verify: A toggle to disable TLS verification for the upstream connection.
  3. HTTP Host Header: An option to explicitly set the Host header sent to the local service

Previous Implementation Example (Caddy):
This scenario was previously handled using Caddy with the following configuration. The transport http block with tls_insecure_skip_verify and proper header forwarding is essential for the setup to work:

(reverse_home) {
    reverse_proxy https://100.92.108.240 {
        header_up Host {host}
        header_up X-Real-IP {remote_host}
        header_up X-Forwarded-For {remote_host}
        header_up X-Forwarded-Proto {scheme}

        transport http {
            tls_insecure_skip_verify
        }
    }
}

https://test.domain.com{
    import reverse_home
}

Requested Improvements:
Add advanced TLS configuration options (equivalent to noTLSVerify and SNI overriding) to the NetBird Service Settings to ensure compatibility with secure internal proxies.

Originally created by @Deniom3 on GitHub (Feb 26, 2026). Original GitHub issue: https://github.com/netbirdio/netbird/issues/5461 Description: The Reverse Proxy feature consistently returns a 502 Bad Gateway error when the target service is configured via HTTPS (port 443). This occurs even when the internal service (e.g., a Traefik or Caddy instance) uses valid SSL certificates. Current Constraints: - Proxying via port 80 (HTTP) to the internal server works correctly. - Proxying via port 443 (HTTPS) results in a 502 error. - Enabling "Pass Host Header" and "Rewrite Redirects" in the current NetBird UI does not resolve the underlying TLS handshake failure. Comparison with Cloudflare Tunnel: To support complex scenarios with internal proxies, similar tools like Cloudflare Tunnel provide specific TLS/HTTP settings that are currently missing in NetBird: 1. Origin Server Name: Allows defining the hostname expected from the origin server certificate 2. No TLS Verify: A toggle to disable TLS verification for the upstream connection. 3. HTTP Host Header: An option to explicitly set the Host header sent to the local service Previous Implementation Example (Caddy): This scenario was previously handled using Caddy with the following configuration. The transport http block with tls_insecure_skip_verify and proper header forwarding is essential for the setup to work: ``` (reverse_home) { reverse_proxy https://100.92.108.240 { header_up Host {host} header_up X-Real-IP {remote_host} header_up X-Forwarded-For {remote_host} header_up X-Forwarded-Proto {scheme} transport http { tls_insecure_skip_verify } } } https://test.domain.com{ import reverse_home } ``` Requested Improvements: Add advanced TLS configuration options (equivalent to noTLSVerify and SNI overriding) to the NetBird Service Settings to ensure compatibility with secure internal proxies.
saavagebueno added the feature-request label 2026-08-05 01:29:52 -04:00
Author
Owner

@dasunsrule32 commented on GitHub (Apr 30, 2026):

This would be great. Pangolin works to my Caddy backends because it supports setting the TLS SNI Server Name. I run Uncloud on the backend and multiple apps that run from there with their different hosts. I get the same 502 errors and when attempting to use TLS passthrough, I only get 404 errors.

<!-- gh-comment-id:4353477679 --> @dasunsrule32 commented on GitHub (Apr 30, 2026): This would be great. Pangolin works to my Caddy backends because it supports setting the TLS SNI Server Name. I run Uncloud on the backend and multiple apps that run from there with their different hosts. I get the same 502 errors and when attempting to use TLS passthrough, I only get 404 errors.
Author
Owner

@doschn commented on GitHub (Apr 30, 2026):

Same behavior in my setup - only direct connections to the backends are working. Accessing resources, where the connections terminate on an internal caddy proxy, results in 404.

TLS handshake errors appear in the log.

<!-- gh-comment-id:4355608775 --> @doschn commented on GitHub (Apr 30, 2026): Same behavior in my setup - only direct connections to the backends are working. Accessing resources, where the connections terminate on an internal caddy proxy, results in 404. TLS handshake errors appear in the log.
Author
Owner

@dasunsrule32 commented on GitHub (Apr 30, 2026):

Yep, same.

<!-- gh-comment-id:4355679014 --> @dasunsrule32 commented on GitHub (Apr 30, 2026): Yep, same.
Author
Owner

@doschn commented on GitHub (May 26, 2026):

no news on this topic so far?

<!-- gh-comment-id:4547464806 --> @doschn commented on GitHub (May 26, 2026): no news on this topic so far?
Author
Owner

@sandroshu commented on GitHub (May 26, 2026):

no news on this topic so far?

You can skip SSL verification, no info about SNI override.

<!-- gh-comment-id:4547489025 --> @sandroshu commented on GitHub (May 26, 2026): > no news on this topic so far? You can skip SSL verification, no info about SNI override.
Author
Owner

@wm-ek commented on GitHub (May 27, 2026):

same

<!-- gh-comment-id:4554990898 --> @wm-ek commented on GitHub (May 27, 2026): same
Author
Owner

@andremohrmann commented on GitHub (Jul 22, 2026):

Big +1 on the Host header part of this specifically, and I want to flag why the recently merged per-target options (#5501) don't cover it.

My backend is an internal Traefik that selects its router by Host. The name the proxy forwards (e.g. service.home.example.com) isn't what my Traefik rule matches, and Pass Host Header only offers two choices: the client's original Host, or the target's hostname. I need a third: a Host value I set explicitly.

#5501 added custom_headers per target, which at first looked like the answer, but it deliberately excludes Host.

Given Host is intentionally filtered out of custom_headers, the clean fix is a dedicated per-target Host, I assume..

This is independent of the SNI override / TLS-verify items in this issue and matters even for plain-HTTP backends, so it could ship on its own.

<!-- gh-comment-id:5043917560 --> @andremohrmann commented on GitHub (Jul 22, 2026): Big +1 on the Host header part of this specifically, and I want to flag why the recently merged per-target options (#5501) don't cover it. My backend is an internal Traefik that selects its router by Host. The name the proxy forwards (e.g. service.home.example.com) isn't what my Traefik rule matches, and Pass Host Header only offers two choices: the client's original Host, or the target's hostname. I need a third: a Host value I set explicitly. #5501 added custom_headers per target, which at first looked like the answer, but it deliberately excludes Host. Given Host is intentionally filtered out of custom_headers, the clean fix is a dedicated per-target Host, I assume.. This is independent of the SNI override / TLS-verify items in this issue and matters even for plain-HTTP backends, so it could ship on its own.
Author
Owner

@dasunsrule32 commented on GitHub (Jul 30, 2026):

I think this is really the only holding me back from using Netbird.

<!-- gh-comment-id:5137664855 --> @dasunsrule32 commented on GitHub (Jul 30, 2026): I think this is really the only holding me back from using Netbird.
Sign in to join this conversation.
No Label feature-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#11506