How to install ssl certificate with Nginx on FreeBSD
Install certbot using following command
pkg install security/py-certbot
pkg install security/py-certbot-nginx
To Obtain the Lets Encrypt Certificate
certbot certonly --webroot -w /path/to/your/webroot/ -d example.com -d www.example.com
Check following lines and add if not there in nginx server config files
server {
listen 443;
server_name example.com;
...
ssl_certificate "/usr/local/etc/letsencrypt/live/example.com/cert.pem";
ssl_certificate_key "/usr/local/etc/letsencrypt/live/example.com/privkey.pem";
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_dhparam /usr/local/etc/letsencrypt/dhparams.pem;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 10m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
...
}
Restart Nginx using following command
service nginx restart