Opened 2 years ago

Closed 2 years ago

#1660 closed defect (invalid)

Docs say $host header comes from the request line?

Reported by: brackendawson@… Owned by:
Priority: minor Milestone:
Component: documentation Version: 1.15.x
Keywords: Cc:
uname -a: Darwin alans-mbp.hursley.uk.ibm.com 18.0.0 Darwin Kernel Version 18.0.0: Wed Aug 22 20:13:40 PDT 2018; root:xnu-4903.201.2~1/RELEASE_X86_64 x86_64
nginx -V: -bash: nginx: command not found

Description

These docs http://nginx.org/en/docs/http/ngx_http_core_module.html#var_host say that the $host variable takes its value first from the request line, this is confusing given the request line does not contain a host. I assume this actually means the value of the server_name?

I'm also seeing answers saying that it will take the value of $http_host first, which contradicts the official docs: https://stackoverflow.com/questions/15414810/whats-the-difference-of-host-and-http-host-in-nginx

Which way round actually is it? And where does the value come from when it is not coming from the Host header?

Change History (1)

comment:1 by Maxim Dounin, 2 years ago

Resolution: invalid
Status: newclosed

Request line can contain a host if the request uses the absolute form of a request line.

Note: See TracTickets for help on using tickets.