Semi-white label server configuration
This guide will help you to configure the semi-white label domain on your server.
You can find more information about certificates at the "Create certificate (ZeroSSL)" part in server setup.
Steps:
Configure the desired semi-whitelabel domain to point (CNAME) to your default domain.
For example:
- default domain: default.yourdomain.com
- semi-whitelabel-domain: whitelabel.yourdomain.com
- whitelabel.yourdomain.com should point to default.yourdomain.com!
OPTIONAL - In the case of the ZeroSSL certificate
- "login" into the certbot container with the next command: docker exec -it certbot /bin/sh
- Find out the webroot path from your basic certificate's config:
- (Usually /var/www/letsencrypt is the webroot path if we provide you a ZeroSSL certificate.)
- Open the default certificate's configuration: vi /etc/letsencrypt/renewal/$DEFAULT_DOMAIN.conf (e.g: vi /etc/letsencrypt/renewal/default.yourdomain.com.conf)
- The webroot path is the path after your domain under the [[webroot_map]] line in the conf file above. For example:
- [[webroot_map]] default.yourdomain.com= /var/www/letsencrypt
From the example above the /var/www/letsencrypt is the webroot path. This will be the $WEBROOT_PATH's value in the next step!
- Create a certificate for your new domain with the following command:
zerossl-bot certonly --webroot -w $WEBROOT_PATH -d $DOMAIN -m $EMAIL
- $WEBROOT_PATH = Replace with that webroot path you found on the step above
- $EMAIL = Replace with your email address. You will get notifications on this email
- $DOMAIN = Replace with the domain you want the certificate for. e.g: whitelabel.yourdomain.com
Follow the app-wb.conf file configuration that you can find in the server setup guide under the "Install Nginx and Certbot" -> "Configuration" -> "Nginx" part.
- DO NOT OVERWRITE the default app-wb.conf file!
- Copy with other name, e.g: app-wb-$DOMAIN.conf -> app-wb-yourdomain.com.conf.
- TL;DR:
- (You can find this config on your host usually under /srv/docker/nginx/sites-enabled)
- Replace the default domain with the new domain inside the new configuration file.
- You have to do this in three places
- at server_name
- at ssl_certificate
- at ssl_certificate_key
Validate and reload Nginx
- "login" into the nginx container: docker exec -it nginx /bin/sh
- Validate that your configurations are in the sites-enabled folder: ls -l /etc/nginx/sites-enabled/
- It should contain your default conf and the new conf file too.
- Example output: app-wb.conf app-wb-yourdomain.com.conf
- Test the Nginx configuration: nginx -t
- The last line of the output should be the following: configuration file /etc/nginx/nginx.conf test is successful
- If the test was successful reload the Nginx with the following command:
- nginx -s reload
- It will do a silent reload, so your server won't be offline.
DONE! You can configure the semi-whitelabel on your content editor now.