-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Host should be $proxy_host, not $host #3247
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
base: develop
Are you sure you want to change the base?
Host should be $proxy_host, not $host #3247
Conversation
* $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
PR is now considered stale. If you want to keep it open, please comment 👍 |
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. |
CI Error:
|
more_set_input_headers 'Host: www.domain-new.com'; Integerated nginx is openresty, that support "headers-more-nginx-module-0.37" modules. so, you can reset the input header by command : more_set_input_headers ================ set input headerslocation /foo {
} |
Not sure I understand how more_set_input_headers helps here. It looks like any custom headers I write, including more_set_input_headers, will appear in the generated conf file before the generated |
$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