Got feedback or spotted a mistake?

Leave a comment at the end of this page or email contact@krishagni.com

Generate SSL cert and configure into Nginx (website)

Download the “certbot-auto” utility

wget https://dl.eff.org/certbot-auto sudo cp certbot-auto /usr/local/bin/certbot-auto sudo chown root /usr/local/bin/certbot-auto sudo chmod 0755 /usr/local/bin/certbot-auto certbot-auto --help

Command to renew the SSL certificate (for particular domain)

certbot-auto certonly --webroot --webroot-path=/var/www/html -d <domain-name>

Example:

To renew the certificate of OpenSpecimen site.

certbot-auto certonly --webroot --webroot-path=/var/www/preprod.openspecimen.org/public_html -d www.openspecimen.org

Renew the certificate of forums site.

Configuring SSL into Nginx

Create configuration file into ‘/etc/nginx/sites-avaiable/site.conf’ directory. Given below is example template to configure SSL into Nginx. (Proxy configuration will change as per application/site).

Example:

Once the SSL certificates are generated and configured, restart the nginx service.

Restart: service nginx restart

Stop: service nginx stop

Start: service nginx start

Test configuration: nginx -t

Got feedback or spotted a mistake?

Leave a comment at the end of this page or email contact@krishagni.com