Skip to content
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

Host should be $proxy_host, not $host #3247

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

vbraun
Copy link

@vbraun vbraun commented Oct 8, 2023

  • $host is the Host sent by the user's browser. This is the correct setting if the service has built-in support for being proxied.

  • $proxy_host is the Host as if the browser would run on the proxy. This is the correct setting if the service does not have built-in support for reverse proxies. It is also the nginx default.

  • In nginx, you cannot unset the Host header. Configuring headers multiple times just sends multiple values with the http request. So there is no way to "fix" the Host by adding a custom header if it is already set.

For these reasons, Host should not be set (and default to $proxy_host). In the unlikely case that your service needs something else you can then just set a custom Host header in the GUI.

Fixes #2675

* $host is the Host sent by the user's browser. This is the correct
  setting if the service has built-in support for being proxied.

* $proxy_host is the Host as if the browser would run on the
  proxy. This is the correct setting if the service does not have
  built-in support for reverse proxies. It is also the nginx default.

* In nginx, you cannot unset the Host header. Configuring headers
  multiple times just sends multiple values with the http request. So
  there is no way to "fix" the Host by adding a custom header if it is
  already set.

For these reasons, Host should not be set (and default to
$proxy_host). In the unlikely case that your service needs something
else you can then just set the header in the GUI.

Fixes NginxProxyManager#2675
@jc21 jc21 added the requires-verification Waiting for one or more people to confirm the fix label Nov 22, 2023
Copy link

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

@github-actions github-actions bot added the stale label May 31, 2024
@valinet
Copy link

valinet commented Jul 23, 2024

How is this STILL not merged? Such a design flaw just obliterates all the usefulness this program brought. PLEASE MERGE THIS and let's have it fixed at last.

@github-actions github-actions bot removed the stale label Sep 10, 2024
@nginxproxymanagerci
Copy link

CI Error:

/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
certbot-node: Pulling from nginxproxymanager/nginx-full
Digest: sha256:eaa2ebcb50dd87557c9a8f95a3230128d94cac1ea17800261c036e59378e7d49
Status: Image is up to date for nginxproxymanager/nginx-full:certbot-node
docker.io/nginxproxymanager/nginx-full:certbot-node
�[1;34m❯ �[1;36mBuilding Frontend ...�[0m
yarn install v1.22.22
[1/4] Resolving packages...
[2/4] Fetching packages...
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
error Command failed.
Exit code: 128
Command: git
Arguments: clone https:/tabler/tabler.git /usr/local/share/.cache/yarn/v6/.tmp/e11a93799a52aa978c82015e29fbe309
Directory: /app/frontend
Output:
Cloning into '/usr/local/share/.cache/yarn/v6/.tmp/e11a93799a52aa978c82015e29fbe309'...
error: RPC failed; curl 92 HTTP/2 stream 5 was not closed cleanly: CANCEL (err 8)
error: 12027 bytes of body are still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
requires-verification Waiting for one or more people to confirm the fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot proxy to sites that require a correct Host header
3 participants