19

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;
27

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.