title: Howto point two domainnames to one website in nginx
body: <p>I have an NGINX webserver, which is serving multiple websites. For each website, I have a seperate nginx configuration file in the /etc/nginx/sites-available folder.</p>
  
  <p>Now, I would like to have two domainnames (aaa.com and bbb.com) point to the same website. On the registrar side both domain names point to the IP address of my webserver.</p>
  
  <p>On nginx, I have the following configuration:</p>
  
  <pre><code>server {
          listen 443 ssl http2;
  
          root /var/www/html/aaa.com/public_html;
          index index.html index.php index.htm;
  
          server_name aaa.com www.aaa.com bbb.com www.bbb.com;
  
          &lt;rest of the configuration
  }
  </code></pre>
  
  <p>I can reach now www.aaa.com but accessing the website via bbb.com does not work.</p>
  
  <p>Should I create a seperate config file (in sites-available) for bbb.com and point to the location of the website in /var/www/html and enable it in sites-enabled?</p>