{"id":186,"date":"2023-04-05T21:27:19","date_gmt":"2023-04-05T19:27:19","guid":{"rendered":"https:\/\/gilbert.busana.lu\/?p=186"},"modified":"2023-04-05T21:27:40","modified_gmt":"2023-04-05T19:27:40","slug":"nginx-create-lets-encrypt-certificate-for-ssl","status":"publish","type":"post","link":"https:\/\/www.homeserver.lu\/?p=186","title":{"rendered":"NGINX: create Let&#8217;s encrypt certificate for SSL"},"content":{"rendered":"\n<p>Before enabling SSL, make sure your vhost has been activated ( see instructions here: <a rel=\"noreferrer noopener\" href=\"https:\/\/gilbert.busana.lu\/?p=165\" target=\"_blank\">https:\/\/gilbert.busana.lu\/?p=165<\/a> ).<br>If let&#8217;s encrypt&#8217;s <em>certbot<\/em> is not installed, proceed here:<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>sudo apt install certbot python3-certbot-nginx<\/code><\/pre><\/div>\n\n\n\n<p>To install the let&#8217;s encrypt certificate, you need to have your external DNS server pointing to your reverse-proxy\/web-server. To install the certificates and have <em>certbot<\/em> modify your vhost config file for you, do:<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>sudo certbot --nginx -d www.mydomain.com<\/code><\/pre><\/div>\n\n\n\n<p>If failed, try:<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>certbot install --cert-name www.domain.com\nnginx -t\nsystemctl restart nginx<\/code><\/pre><\/div>\n\n\n\n<p>If everything went well, your certificate is saved at: <em>\/etc\/letsencrypt\/live\/www.mydomain.com\/fullchain.pem<\/em><br>The key is saved at: <em>\/etc\/letsencrypt\/live\/www.mydomain.com\/privkey.pem<\/em><br>Certbot also modifies your vhost vonfiguration file and adds SSL on port 443 and redirects unencrypted (http) traffic to secure sockets (https). Check your configuration file here: <em>\/etc\/nginx\/sites-enabled\/www.mydomain.com<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Before enabling SSL, make sure your vhost has been activated ( see instructions here: https:\/\/gilbert.busana.lu\/?p=165 ).If let&#8217;s encrypt&#8217;s certbot is not installed, proceed here: To install the let&#8217;s encrypt certificate, you need to have your external DNS server pointing to your reverse-proxy\/web-server. To install the certificates and have certbot modify your vhost config file for [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[16,15],"tags":[],"class_list":["post-186","post","type-post","status-publish","format-standard","hentry","category-reverse-proxy","category-webserver"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=\/wp\/v2\/posts\/186","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=186"}],"version-history":[{"count":4,"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=\/wp\/v2\/posts\/186\/revisions"}],"predecessor-version":[{"id":190,"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=\/wp\/v2\/posts\/186\/revisions\/190"}],"wp:attachment":[{"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=186"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=186"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=186"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}