Add port to to the header in Nginx config (#5101)
* Add port to to the header in Nginx config Using `$host` only for the header in Nginx config causes that Kestrel knows only that its host name is *hostname.com* without any port. That will cause problems in redirecting (e.g. to login page). I added the `$server_port` as well. So the hostname will become *hostname.com:8080* for example. That solves any related redirecting problems. * Using $http_host in nginx config `$http_host` is more accurate that `$host` because if includes the port number. using `$host` will cause problems when running kestrel behind reverse proxy on ports other than the standard ports (80 and 443).pull/5110/head
parent
eb9e5af270
commit
36868fb63c
|
@ -116,7 +116,7 @@ server {
|
|||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection keep-alive;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_cache_bypass $http_upgrade;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue