Setting up an SSL certificate
In order for the store to be accessible via the HTTPS protocol, it is necessary not only to install the SSL certificate, but also to activate it. To do this, install cerbot , which will automatically update the SSL certificate:
# apt-get install certbot
We launch it and wait for a response about receiving the certificate (from here on, do not forget to replace your-domain.com to your website domain):
# certbot certonly --webroot --register-unsafely-without-email -w /var/melbis/certbot -d your-domain.com
Copy the certificate to the folder we need:
# cp -f /etc/letsencrypt/live/ your-domain.com /* /var/melbis/certs/
Restart the Ngnix server in the container:
# docker exec melbis_nginx_1 nginx -s reload
And we add automatic certificate update to the scheduler:
# crontab -e
0 3 * * * certbot renew --quiet && cp -f /etc/letsencrypt/live/ your-domain.com /* /var/melbis/certs/ && docker exec melbis_nginx_1 nginx -s reload