Welcome! Log In Create A New Profile

Advanced

The real difference between $host and $http_host

August 15, 2011 03:30AM
The wiki page of "$host" says $host and $host_addr are different only when there is no "Host" header or the "Host" header is empty. But I found when "Host" contains port number, $host never contains the port number while $http_host is equal to the value of "Host" header.

That is, if "Host: foo:8080", then
$http_host = foo:8080
$host = foo

So in this case, they are different.

Tested in nginx 1.0.3

I want the official confirmation of this difference. And if it's confirmed, could you correct the illustration in wiki page?

Thanks.
Subject Author Posted

The real difference between $host and $http_host

speedfirst August 15, 2011 03:30AM

Re: The real difference between $host and $http_host

Maxim Dounin August 15, 2011 06:20AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 69
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready