Skip to content

Documented the default Host value for an empty proxy_set_header value - #325

Draft
VadimZhestikov wants to merge 1 commit into
nginx:mainfrom
VadimZhestikov:docs-proxy-set-header-empty-host
Draft

Documented the default Host value for an empty proxy_set_header value#325
VadimZhestikov wants to merge 1 commit into
nginx:mainfrom
VadimZhestikov:docs-proxy-set-header-empty-host

Conversation

@VadimZhestikov

Copy link
Copy Markdown
Contributor

Since 1.31.4 (dea68dbf126f) an empty Host value no longer suppresses the
field: the $proxy_host value is passed instead, because the http and
https URI schemes require a non-empty host identifier (RFC 9110, 4.2.1 and
4.2.2). The same applies to the :authority pseudo-header field for HTTP/2
and gRPC.

The reference documentation still described the previous behaviour in three
places:

  • proxy_set_header -- "If the value of a header field is an empty string then
    this field will not be passed to a proxied server."
  • proxy_set_header -- "if this field is not present in a client request header
    then nothing will be passed", which is the $http_host case.
  • grpc_set_header -- the same empty-value statement, which now also covers
    :authority.

An empty value can therefore no longer be used to suppress the field, or as a
way to signal that a request should not be proxied, and this is now noted
explicitly. The HTTP/1.0 case, where an empty value still suppresses the
field, is documented as the exception.

Both xml/en and xml/ru are updated in this change.

Opened as a draft.

Since 1.31.4 (dea68dbf126f) an empty "Host" value no longer suppresses
the field: the $proxy_host value is passed instead, because the http and
https URI schemes require a non-empty host identifier.  The same applies
to the ":authority" pseudo-header field for HTTP/2 and gRPC.

The proxy_set_header and grpc_set_header descriptions still stated that
an empty value is never passed, and the proxy_set_header text also
stated that nothing is passed when the client sends no "Host" header
field, which is the $http_host case.  An empty value can therefore no
longer be used to suppress the field or as a deny sentinel, so this is
noted explicitly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant