nginx-proxy-manager icon indicating copy to clipboard operation
nginx-proxy-manager copied to clipboard

force-ssl behind another proxy using http_x_forwarded_proto

Open paucapo opened this issue 1 year ago • 5 comments

Fix for issue #3365 and pull request #3589

paucapo avatar Jun 22 '24 13:06 paucapo

Change looks good, can you confirm that this docker image works as you expect?

jc21 avatar Jun 25 '24 00:06 jc21

Seems like is working as expected, but maybe some additional tests with configurations a bit more elaborated than mine will be a good idea.

paucapo avatar Jun 25 '24 09:06 paucapo

This doesn't work when you have Cloudflare Tunnel (cloudflared) connecting to an https nginx endpoint and they requested HTTP.

The working code changes this:

if ($http_x_forwarded_proto = "https") {
	set $test "";
}

to this:

if ($http_x_forwarded_proto = "http") {
	set $test "H";
}

It then works as expected.

cbenard avatar Aug 15 '24 04:08 cbenard

PR is now considered stale. If you want to keep it open, please comment :+1:

github-actions[bot] avatar May 21 '25 02:05 github-actions[bot]

Docker Image for build 8 is available on DockerHub:

nginxproxymanager/nginx-proxy-manager-dev:pr-3819

[!NOTE] Ensure you backup your NPM instance before testing this image! Especially if there are database changes. This is a different docker image namespace than the official image.

[!WARNING] Changes and additions to DNS Providers require verification by at least 2 members of the community!