Adding new nginx server block + installing SSL certificate for it

This guide is useful if you're using HostBill Multi-Brand module on HostBill Enterprise install. This guide assumes you're familiar with linux file editors (like vim or nano).


  1. Issuing CSR / private key for new certificate:
    Lets first create dir to store certificate requests and private keys. Login to your HostBill server using ssh and issue following commands:

    Next, we'll issue CSR for new host, you will be prompted with a series of questions, answer them (when asked about passphrase you can leave it blank):

  2. Issue SSL certificate
    Use generated CSR with your SSL Certificates reseller to generate certificate. Once ready, paste its contents to:


    Placing your site certificate at top of said file, followed by Intermediate certificate (if any)

  3. Adding new vhost (server block) to nginx:

    Make a copy /etc/nginx/conf.d/main.conf file:

    Update ssl_certificate* and server_name blocks in /etc/nginx/conf.d/yourbrand.com.conf file:

  4. Reload nginx to apply new site block + ssl certificate: