Server Name Issue

merlin corey merlincorey at dc949.org
Sat Dec 12 03:19:17 MSK 2009


Hello,

You need a custom log format that uses $http_host instead of
$server_name, please see
http://wiki.nginx.org/NginxHttpLogModule#log_format .

You may also want to use 'server_name_in_redirect off' to ensure that
server_name is not passed back to clients.

Thanks,
Merlin

On Mon, Dec 7, 2009 at 3:32 AM, Rahul Bansal <rahul.bansal at rtcamp.com> wrote:
> Hi All,
> I have created a virtual host where I want to handle unlimited top-level
> domains.
> Domains are registered elsewhere and I am using "A record" pointing to my
> nginx server's dedciated IP at respective domains registrars/name-servers.
> I have following in my vhost config file...
>>
>> server {
>>
>>         listen          80 default;
>>
>> server_name _ "";
>
> Everything is working expect some minor issues.
>
> Logs shows server name as "_"
> Cookies and some scripts where host is supposed to be host in URL, it is set
> to "_"
>
> Its not breaking anything. And everything is working cool.
> But is there anyway to have server_name set to "host"name in HTTP request?
> Thanks,
> -Rahul
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx
>
>



More information about the nginx mailing list