Multiple server_name directives?

Maxim Dounin mdounin at mdounin.ru
Mon Jul 29 17:25:24 UTC 2019


Hello!

On Thu, Jul 25, 2019 at 11:59:59AM +0200, rainer at ultra-secure.de wrote:

> I found that using multiple
> 
> server_name bla;
> server_name blu;
> 
> directives seems to actually work.
> 
> At least in 1.12.
> 
> 
> Can someone from @nginx comment on whether using that is a good idea?
> Or is that deprecated already?
> 
> The documentation doesn't mention it.

This is something more or less universaly works for directives 
which accept arbitrary number of parameters, such as "server_name" 
or "index", as well as bitmask-style directives like 
"ssl_protocols" and "proxy_next_upstream".

This is not something documented though, and I personally would 
rather avoid configuring things this way - mostly because I 
suspect this can be accidentally broken if a particular directive 
handling is changed for some reason.  On the other hand, there are 
no plans to remove and/or deprecate such syntax intentionally.

-- 
Maxim Dounin
http://mdounin.ru/


More information about the nginx mailing list