mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 05:23:35 +00:00
The `$host` nginx variable is _not_ the unadulterated `Host` header (which would be `$http_host`) -- it is that header, *without the port*, with a fallback to the `server_name` which processed the request. This means that backend services are not aware of the port that the request came in on, unless they derive that from reading `nginx_listen_port` in `/etc/zulip/zulip.conf`, or similar. Specifically, this caused `tusd`, on deploys with non-standard `nginx_listen_port`, to generate a `Location` header which left off the port, and as such attempted a CORS check when retrieving metadata about the just-uploaded file, which failed. Add the port to the `Host` header we pass to `tusd` and other backend services.