{"id":385,"date":"2020-04-23T05:07:46","date_gmt":"2020-04-22T21:07:46","guid":{"rendered":"https:\/\/unama.website\/?p=385"},"modified":"2020-04-23T05:11:00","modified_gmt":"2020-04-22T21:11:00","slug":"configuring-lets-encrypt-ssl-certificate-for-nginx-on-ubuntu-18-04","status":"publish","type":"post","link":"https:\/\/unama.website\/?p=385","title":{"rendered":"Configuring Let\u2019s Encrypt SSL Certificate for Nginx on Ubuntu 18.04"},"content":{"rendered":"\n<h2>&nbsp;Install Let\u2019s Encrypt client (Certbot)<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get update &amp;&amp; sudo apt-get install software-properties-common\nsudo add-apt-repository universe &amp;&amp; sudo add-apt-repository ppa:certbot\/certbot\nsudo apt-get update &amp;&amp; sudo apt-get install certbot python-certbot-nginx<\/code><\/pre>\n\n\n\n<h2>Configure the Firewall<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo ufw allow OpenSSH\nsudo ufw allow 'Nginx Full'\nsudo ufw delete allow 'Nginx HTTP'\nsudo ufw status<\/code><\/pre>\n\n\n\n<p>\u61c9\u8a72\u8981\u770b\u5230:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Status: active\n\nTo                         Action      From\n--                         ------      ----\nOpenSSH                    ALLOW       Anywhere\nNginx Full                 ALLOW       Anywhere\nOpenSSH (v6)               ALLOW       Anywhere (v6)\nNginx Full (v6)            ALLOW       Anywhere (v6) <\/code><\/pre>\n\n\n\n<h2>Get an SSL Certificate<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo certbot --nginx<\/code><\/pre>\n\n\n\n<p>\u586b\u4e0a\u4f60\u7684\u806f\u7d61email<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Enter email address (used for urgent renewal and security notices) (Enter 'c' to\ncancel):<\/code><\/pre>\n\n\n\n<p>Agree\u5f8center<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Please read the Terms of Service at\nhttps:\/\/letsencrypt.org\/documents\/LE-SA-v1.2-November-15-2017.pdf. You must\nagree in order to register with the ACME server at\nhttps:&#47;&#47;acme-v02.api.letsencrypt.org\/directory\n-------------------------------------------------------------------------------\n(A)gree\/(C)ancel:<\/code><\/pre>\n\n\n\n<p>No, \u4e0d\u7528\u5206\u4eab<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Would you be willing to share your email address with the Electronic Frontier\nFoundation, a founding partner of the Let's Encrypt project and the non-profit\norganization that develops Certbot? We'd like to send you email about EFF and\nour work to encrypt the web, protect its users and defend digital rights.\n-------------------------------------------------------------------------------\n(Y)es\/(N)o:<\/code><\/pre>\n\n\n\n<p>\u4ed6\u6703\u6383\u4f60\u7684\u8a2d\u5b9a\u6a94\uff0c\u77e5\u9053\u4f60\u7684domain name\uff0c\u9078\u4f60\u559c\u6b61\u7684\u6216\u7a7a\u683c\u7b49\u65bc\u5168\u9078<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Which names would you like to activate HTTPS for?\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n1: yourdomain.com\n2: www.yourdomain.com\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nSelect the appropriate numbers separated by commas and\/or spaces, or leave input\nblank to select all options shown (Enter 'c' to cancel)<\/code><\/pre>\n\n\n\n<p>\u90782\uff0c\u8b93\u6240\u6709request\u90fd\u91cd\u5c0e\u81f3https<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Congratulations! You have successfully enabled https:\/\/yourdomain.com\n\nYou should test your configuration at:\nhttps:&#47;&#47;www.ssllabs.com\/ssltest\/analyze.html?d=yourdomain.com<\/code><\/pre>\n\n\n\n<p>\u9019\u6642\u5019\u958b\u555fhttps:\/\/yourdomain.com\uff0c\u4f86\u6aa2\u67e5SSL\u6191\u8b49\u662f\u5426\u9806\u5229\u904b\u4f5c! \u53ef\u4ee5\u5230\u4ed6\u7d66\u7684SSL Labs\u7684\u7db2\u7ad9\u6e2c\u8a66\u4f60\u7684SSL\u5b89\u5168\u7b49\u7d1a\u3002<\/p>\n\n\n\n<p>\u6ce8\u610f: SSL Labs \u57282020\/1\/31\u5c07\u6240\u6709\u5141\u8a31TLS 1.0\u548cTLS 1.1\u7684\u7db2\u7ad9\u5206\u6578\u4e00\u5f8b\u8abf\u6210B\uff0c\u800cCertbot\u76ee\u524d\u8a2d\u5b9a\u9810\u8a2d\u9084\u662f\u5141\u8a31TLS 1.0\u548cTLS 1.1\u7684<\/p>\n\n\n\n<p>\u9019\u7bc7<a href=\"?p=388\">Turn Your Website SSL Labs Test Grade to A+<\/a>\u80fd\u5e6b\u4f60\u63d0\u5347\u4f60\u7684\u7db2\u7ad9SSL\u5206\u6578<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp;Install Let\u2019s Encrypt client (Certbot) Configure the Firewall \u61c9\u8a72\u8981\u770b\u5230: Get a&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"https:\/\/unama.website\/?p=385\"> Read More<span class=\"screen-reader-text\">  Read More<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[7,5],"tags":[],"_links":{"self":[{"href":"https:\/\/unama.website\/index.php?rest_route=\/wp\/v2\/posts\/385"}],"collection":[{"href":"https:\/\/unama.website\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unama.website\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unama.website\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unama.website\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=385"}],"version-history":[{"count":2,"href":"https:\/\/unama.website\/index.php?rest_route=\/wp\/v2\/posts\/385\/revisions"}],"predecessor-version":[{"id":392,"href":"https:\/\/unama.website\/index.php?rest_route=\/wp\/v2\/posts\/385\/revisions\/392"}],"wp:attachment":[{"href":"https:\/\/unama.website\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=385"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unama.website\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=385"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unama.website\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=385"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}