nginx / nginx/documentation

[Request]: nginx $host variable explanation is unclear about HTTP/2,3 behaviour

Open
#1,431 0 comments 0 reactions 1 assignee View on GitHub

@y82 is already working on this.

Since Nov 12, 2025.

documentation P3 - Normal (TTR: 1 month) product/nginx-plus
Dominant language
HTML
Stars
94
Forks
174
Avg merge
1d 10h
Merged PRs (30d)
66

Description

What would you like the documentation team to work on?

https://nginx.org/en/docs/http/ngx_http_core_module.html#var_host is explained thus:

in this order of precedence: host name from the request line, or host name from the “Host” request header field, or the server name matching a request

Ref: https://github.com/nginx/nginx.org/blob/main/xml/en/docs/http/ngx_http_core_module.xml#L3189

As HTTP/3 does not have a conventional request line or request headers, I am unsure if the HTTP/2 or HTTP/3 :authority field will be used to populate $host.

Additional clarity here would help to avoid people using $http_host in dangerous/unpredictable ways.

Which product or products does this request relate to?

Other

Who is the person directly responsible for initiating this request?

@lcrilly

Is this request part of a larger initiative or project?

No

Are there important constraints for this request?

No

Does this request have a due date?

No

Any additional information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.