Server Name Issue

Igor Sysoev igor at sysoev.ru
Sat Dec 12 23:00:09 MSK 2009


On Sat, Dec 12, 2009 at 11:23:09PM +0530, Rahul Bansal wrote:

> Hi Merlin,
> 
> Thanks for ur reply.
> 
> But can I do something like "set server_name $http_host"?
> 
> For some reason that I cannot explain (lack of my knowledge may be) I need
> server_name to reflect http_host value.

Where do you use this server_name ?

> Is there any workaround which just works with nginx 0.7.
> 
> Thanks,
> -Rahul
> 
> 
> On Sat, Dec 12, 2009 at 5:49 AM, merlin corey <merlincorey at dc949.org> wrote:
> 
> > 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
> > >
> > >
> >
> > _______________________________________________
> > nginx mailing list
> > nginx at nginx.org
> > http://nginx.org/mailman/listinfo/nginx
> >

> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx


-- 
Igor Sysoev
http://sysoev.ru/en/



More information about the nginx mailing list