54

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;
Holly
  • 907
  • 5
  • 13
  • 24

1 Answers1

71

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).

Maxim Dounin
  • 3,466
  • 17
  • 22