Multiple server_name directives in same server block?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Multiple server_name directives in same server block?

Roger Fischer
Hello,

is it possible to have multiple server_name directives in the same server block?

I.e. is the following possible?

server {
    listen 1.2.3.4:443 ssl;
    server_name *.site1.org *.site2.org;
    server_name ~^app1.*\.site3\.org$;
    ….

Or do I need to create a second server block?

Thanks…

Roger


_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

Re: Multiple server_name directives in same server block?

Francis Daly
On Fri, Dec 20, 2019 at 05:25:05PM -0800, Roger Fischer wrote:

Hi there,

> is it possible to have multiple server_name directives in the same server block?

A quick test shows that "nginx -t" does not object; and that the
server_name values are matched with the Host: header as expected.

So: yes.

        f
--
Francis Daly        [hidden email]
_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx