{"id":494,"date":"2024-10-04T08:06:24","date_gmt":"2024-10-04T08:06:24","guid":{"rendered":"https:\/\/bbotech.vn\/create-an-ssl-certificate-for-n8n-server-using-nginx-2\/"},"modified":"2025-10-28T08:14:53","modified_gmt":"2025-10-28T08:14:53","slug":"create-an-ssl-certificate-for-n8n-server-using-nginx-2","status":"publish","type":"post","link":"https:\/\/bbotech.vn\/vi\/create-an-ssl-certificate-for-n8n-server-using-nginx-2\/","title":{"rendered":"H\u01b0\u1edbng d\u1eabn t\u1ea1o ch\u1ee9ng ch\u1ec9 SSL cho server n8n s\u1eed d\u1ee5ng Nginx"},"content":{"rendered":"<h3 data-start=\"123\" data-end=\"140\">Y\u00eau c\u1ea7u<\/h3>\n<ul data-start=\"141\" data-end=\"366\">\n<li data-start=\"141\" data-end=\"213\">\n<p data-start=\"143\" data-end=\"213\">M\u00e1y ch\u1ee7 ch\u1ea1y <strong data-start=\"160\" data-end=\"170\">Ubuntu<\/strong> (ho\u1eb7c h\u1ec7 \u0111i\u1ec1u h\u00e0nh t\u01b0\u01a1ng t\u1ef1 h\u1ed7 tr\u1ee3 Certbot).<\/p>\n<\/li>\n<li data-start=\"214\" data-end=\"238\">\n<p data-start=\"216\" data-end=\"238\"><strong data-start=\"216\" data-end=\"225\">Nginx<\/strong> \u0111\u00e3 \u0111\u01b0\u1ee3c c\u00e0i \u0111\u1eb7t.<\/p>\n<\/li>\n<li data-start=\"239\" data-end=\"273\">\n<p data-start=\"241\" data-end=\"273\"><strong data-start=\"241\" data-end=\"248\">n8n<\/strong> \u0111\u00e3 \u0111\u01b0\u1ee3c c\u00e0i \u0111\u1eb7t v\u00e0 \u0111ang ch\u1ea1y.<\/p>\n<\/li>\n<li data-start=\"274\" data-end=\"331\">\n<p data-start=\"276\" data-end=\"331\">M\u1ed9t <strong data-start=\"278\" data-end=\"293\">t\u00ean mi\u1ec1n<\/strong> \u0111\u00e3 tr\u1ecf \u0111\u1ebfn \u0111\u1ecba ch\u1ec9 IP c\u1ee7a m\u00e1y ch\u1ee7.<\/p>\n<\/li>\n<li data-start=\"332\" data-end=\"366\">\n<p data-start=\"334\" data-end=\"366\">C\u1ed5ng <strong data-start=\"340\" data-end=\"346\">80<\/strong> v\u00e0 <strong data-start=\"351\" data-end=\"358\">443<\/strong> \u0111ang m\u1edf.<\/p>\n<\/li>\n<\/ul>\n<hr data-start=\"368\" data-end=\"371\" \/>\n<h3 data-start=\"373\" data-end=\"396\">1. C\u00e0i \u0111\u1eb7t Certbot<\/h3>\n<p data-start=\"397\" data-end=\"480\">Certbot l\u00e0 m\u1ed9t c\u00f4ng c\u1ee5 \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng \u0111\u1ec3 t\u1ea1o v\u00e0 gia h\u1ea1n ch\u1ee9ng ch\u1ec9 SSL t\u1eeb Let\u2019s Encrypt.<\/p>\n<h4 data-start=\"482\" data-end=\"518\">a. C\u00e0i \u0111\u1eb7t Certbot tr\u00ean m\u00e1y ch\u1ee7<\/h4>\n<div class=\"contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary\">\n<div class=\"sticky top-9\">\n<div class=\"absolute end-0 bottom-0 flex h-9 items-center pe-2\">\n<div class=\"bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs\"><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-bash\">sudo apt update<br \/>\nsudo apt install certbot<br \/>\n<\/code><\/div>\n<\/div>\n<h4 data-start=\"575\" data-end=\"603\">b. X\u00e1c minh c\u00e0i \u0111\u1eb7t<\/h4>\n<div class=\"contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary\">\n<div class=\"sticky top-9\">\n<div class=\"absolute end-0 bottom-0 flex h-9 items-center pe-2\">\n<div class=\"bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs\"><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-bash\">certbot --version<br \/>\n<\/code><\/div>\n<\/div>\n<p data-start=\"636\" data-end=\"701\">K\u1ebft qu\u1ea3 s\u1ebd hi\u1ec3n th\u1ecb phi\u00ean b\u1ea3n, v\u00ed d\u1ee5: <code data-start=\"683\" data-end=\"698\">certbot 2.x.x<\/code>.<\/p>\n<h4 data-start=\"703\" data-end=\"739\">c. T\u1ea1o ch\u1ee9ng ch\u1ec9 SSL<\/h4>\n<div class=\"contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary\">\n<div class=\"sticky top-9\">\n<div class=\"absolute end-0 bottom-0 flex h-9 items-center pe-2\">\n<div class=\"bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs\"><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-bash\">sudo certbot certonly --standalone -d yourdomain.com<br \/>\n<\/code><\/div>\n<\/div>\n<ul data-start=\"807\" data-end=\"945\">\n<li data-start=\"807\" data-end=\"900\">\n<p data-start=\"809\" data-end=\"900\"><code data-start=\"809\" data-end=\"823\">--standalone<\/code> y\u00eau c\u1ea7u Certbot ch\u1ea1y m\u1ed9t m\u00e1y ch\u1ee7 web t\u1ea1m th\u1eddi nh\u1ecf \u0111\u1ec3 x\u00e1c th\u1ef1c t\u00ean mi\u1ec1n c\u1ee7a b\u1ea1n.<\/p>\n<\/li>\n<li data-start=\"901\" data-end=\"945\">\n<p data-start=\"903\" data-end=\"945\"><code data-start=\"903\" data-end=\"922\">-d yourdomain.com<\/code> l\u00e0 t\u00ean mi\u1ec1n c\u1ee7a b\u1ea1n.<\/p>\n<\/li>\n<\/ul>\n<p data-start=\"947\" data-end=\"1118\">Certbot s\u1ebd h\u1ecfi b\u1ea1n m\u1ed9t v\u00e0i c\u00e2u h\u1ecfi (ch\u1eb3ng h\u1ea1n nh\u01b0 email \u0111\u1ec3 nh\u1eadn th\u00f4ng b\u00e1o). Nh\u1eadp th\u00f4ng tin chi ti\u1ebft v\u00e0 \u0111\u1ee3i v\u00e0i gi\u00e2y. Sau khi ho\u00e0n t\u1ea5t, ch\u1ee9ng ch\u1ec9 s\u1ebd \u0111\u01b0\u1ee3c l\u01b0u tr\u1eef t\u1ea1i:<\/p>\n<div class=\"contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary\">\n<div class=\"sticky top-9\">\n<div class=\"absolute end-0 bottom-0 flex h-9 items-center pe-2\">\n<div class=\"bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs\"><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre!\"><span class=\"hljs-regexp\">\/etc\/<\/span>letsencrypt<span class=\"hljs-regexp\">\/live\/<\/span>yourdomain.com<span class=\"hljs-operator\">\/<\/span><br \/>\n<\/code><\/div>\n<\/div>\n<p data-start=\"1169\" data-end=\"1215\">Sao ch\u00e9p c\u00e1c t\u1ec7p v\u00e0o th\u01b0 m\u1ee5c <code data-start=\"1193\" data-end=\"1202\">.\/certs<\/code>:<\/p>\n<div class=\"contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary\">\n<div class=\"sticky top-9\">\n<div class=\"absolute end-0 bottom-0 flex h-9 items-center pe-2\">\n<div class=\"bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs\"><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-bash\">sudo <span class=\"hljs-built_in\">mkdir<\/span> -p .\/certs<br \/>\nsudo <span class=\"hljs-built_in\">cp<\/span> \/etc\/letsencrypt\/live\/yourdomain.com\/fullchain.pem .\/certs\/<br \/>\nsudo <span class=\"hljs-built_in\">cp<\/span> \/etc\/letsencrypt\/live\/yourdomain.com\/privkey.pem .\/cer<br \/>\n<\/code><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Y\u00eau c\u1ea7u M\u00e1y ch\u1ee7 ch\u1ea1y Ubuntu (ho\u1eb7c h\u1ec7 \u0111i\u1ec1u h\u00e0nh t\u01b0\u01a1ng t\u1ef1 h\u1ed7 tr\u1ee3 Certbot). Nginx \u0111\u00e3 \u0111\u01b0\u1ee3c c\u00e0i \u0111\u1eb7t. n8n \u0111\u00e3 \u0111\u01b0\u1ee3c c\u00e0i \u0111\u1eb7t v\u00e0 \u0111ang ch\u1ea1y. M\u1ed9t t\u00ean mi\u1ec1n \u0111\u00e3 tr\u1ecf \u0111\u1ebfn \u0111\u1ecba ch\u1ec9 IP c\u1ee7a m\u00e1y ch\u1ee7. C\u1ed5ng 80 v\u00e0 443 \u0111ang m\u1edf. 1. C\u00e0i \u0111\u1eb7t Certbot Certbot l\u00e0 m\u1ed9t c\u00f4ng c\u1ee5 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":495,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[25],"tags":[],"class_list":["post-494","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tin-cong-nghe"],"acf":[],"_links":{"self":[{"href":"https:\/\/bbotech.vn\/vi\/wp-json\/wp\/v2\/posts\/494","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bbotech.vn\/vi\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bbotech.vn\/vi\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bbotech.vn\/vi\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bbotech.vn\/vi\/wp-json\/wp\/v2\/comments?post=494"}],"version-history":[{"count":1,"href":"https:\/\/bbotech.vn\/vi\/wp-json\/wp\/v2\/posts\/494\/revisions"}],"predecessor-version":[{"id":510,"href":"https:\/\/bbotech.vn\/vi\/wp-json\/wp\/v2\/posts\/494\/revisions\/510"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/bbotech.vn\/vi\/wp-json\/wp\/v2\/media\/495"}],"wp:attachment":[{"href":"https:\/\/bbotech.vn\/vi\/wp-json\/wp\/v2\/media?parent=494"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bbotech.vn\/vi\/wp-json\/wp\/v2\/categories?post=494"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bbotech.vn\/vi\/wp-json\/wp\/v2\/tags?post=494"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}