can multiple domain points a single nginx host with server_name ?

Joydeep Bakshi joydeep.bakshi at netzrezepte.de
Mon Apr 28 13:27:18 UTC 2014


Thanks to both of you


On Mon, Apr 28, 2014 at 6:46 PM, Jonathan Matthews
<contact at jpluscplusm.com>wrote:

> On 28 Apr 2014 12:44, "Joydeep Bakshi" <joydeep.bakshi at netzrezepte.de>
> wrote:
> >  is
> >
> > nginx  [ server_name  test1.com test2.com www.test3.com  ]
> >
> > equivalent to
> >
> > apache  [
> > servername test1.com
> > serveralias   test2.com www.test3.com ]
> >
> > ?
>
> As Maxim says, yes.
>
> If you have hardcoded names, i believe there are 3 ways to format it:
>
> 1 -------------------
> server_name foo.example.com foo2.example.com foo3.example.com;
> 2 -------------------
> server_name foo.example.com
>                    foo2.example.com
>                    foo3.example.com;
> 3 -------------------
> server_name foo.example.com;
> server_name foo2.example.com;
> server_name foo3.example.com;
> ---------------------
>
> Note the different semicolon placement in each. They are, I believe,
> functionally and performance-ly identical.
>
> They each have their different uses depending on how you amend,
> interrogate and share your configurations. E.g. #3 is handy when you'll be
> grepping for the fixed string "server_name foo2.example.com".
>
> Consistency is probably most important, however: choose one style and
> stick to it :-)
>
> HTH,
> J
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20140428/27f2d0d2/attachment-0001.html>


More information about the nginx mailing list