How do I make my domain listen under "www."?

DocumentationDomains > How do I make my domain listen under "www."?

To make your domain listen on www.example.com instead of example.com you have to do the following steps. (Make sure you replace example.com with your own domain)

  1. Change the server_name variable inside your nginx config. You can find this config file in this path (or you can use our UI to edit): /etc/nginx/sites-available/example.com
  2. (Optional): If you have SSL enabled, you will have to edit the redirect too. Open up this file: /etc/nginx/ploi/example.com/before/ssl-redirect.conf and edit these lines:

server_name www.example.com 
TO 
server_name example.com


return 301 https://example.com$request_uri;

TO 
return 301 https://www.example.com$request_uri;

 3. After this, save these files and restart NGINX.

10 March 2019
291 views