ln -s /etc/nginx/sites-available/{{ domain() }}.conf /etc/nginx/sites-enabled/{{ domain() }}.conf
openssl dhparam -dsaparam -out /etc/nginx/dhparam.pem {{ isSSLProfileOld() ? 1024 : 2048 }}
sudo -u {{ data.user }} sh -c "mkdir -p /var/www/_letsencrypt"
sed -i -r 's/listen (.*)443/listen \1443;#/g; s/ssl_(certificate|certificate_key|trusted_certificate) /#;#ssl_\1/g' /etc/nginx/sites-{{ isSymlink() ? 'available' : 'enabled' }}/{{ domain() }}.conf
certbot certonly --webroot -d {{ domain() }} -d www.{{ domain() }} -d cdn.{{ domain() }} --email {{ data.email ? data.email : 'info@' + domain() }} -w /var/www/_letsencrypt -n --agree-tos --force-renewal
sed -i -r 's/#?;#//g' /etc/nginx/sites-{{ isSymlink() ? 'available' : 'enabled' }}/{{ domain() }}.conf