[PR #3247] Host should be $proxy_host, not $host #3673

Open
opened 2026-02-26 08:31:31 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/NginxProxyManager/nginx-proxy-manager/pull/3247
Author: @vbraun
Created: 10/8/2023
Status: 🔄 Open

Base: developHead: use-proxy-host-instead-of-host


📝 Commits (1)

  • 30787f7 Host should be $proxy_host, not $host

📊 Changes

1 file changed (+0 additions, -1 deletions)

View changed files

📝 docker/rootfs/etc/nginx/conf.d/include/proxy.conf (+0 -1)

📄 Description

  • $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 https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2675


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/NginxProxyManager/nginx-proxy-manager/pull/3247 **Author:** [@vbraun](https://github.com/vbraun) **Created:** 10/8/2023 **Status:** 🔄 Open **Base:** `develop` ← **Head:** `use-proxy-host-instead-of-host` --- ### 📝 Commits (1) - [`30787f7`](https://github.com/NginxProxyManager/nginx-proxy-manager/commit/30787f7ee3d1c73d01815b18581a48c54b066c6f) Host should be $proxy_host, not $host ### 📊 Changes **1 file changed** (+0 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `docker/rootfs/etc/nginx/conf.d/include/proxy.conf` (+0 -1) </details> ### 📄 Description * $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 https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2675 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#3673
No description provided.