Nginx, where does the host name in this error come from?

Danack asked:

I have a server setup with the name ‘’. I have an error being generated by the application, and the error text is being appropriately logged as:

[error] 9#9: *6916 FastCGI sent in stderr: “application error
” while reading response header from upstream, client:, server: *, request: “GET / HTTP/1.1”, upstream: “fastcgi://”, host:

However…I am completely confused as to where the domain “” is coming from.

It is another domain I control, and that domain has a wildcard subdomain setup, so it resolves to the same IP address as ‘’. But I would much rather than correct host name was used.

Any ideas where that host name can be coming from? Or how to tell (presumably) Nginx to use the correct host name in the log?

My answer:

In nginx error log entries such as this:

The “server:” indicates the server_name of the server block which handled the request.

The “host:” indicates the hostname sent by the browser or user agent in the Host: request header.

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.