64

I'm moving a site to a new server running on NGINX. The old site's Apache2 VirtualHost has ServerAlias configured that I want to replicate in the NGINX configuration.

From what I've read on the NGINX Docs this seems to be simply achieved with server_name.

I just want to make sure what I have is correct.

From APACHE2

ServerAlias our-domain.com www1.our-domain.com our-domain.ie

To NGINX

server_name www.our-domain.com our-domain.com www.our-domain.ie our-domain.ie;

1 Answer 1

84

Yes, just using server_name with serveral names is perfectly correct. The first name will be used as canonical one (similar to Apache ServerName), and others as aliases (similar to Apache ServerAlias).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .