{"id":7715,"date":"2026-08-10T13:15:47","date_gmt":"2026-08-10T04:15:47","guid":{"rendered":"https:\/\/www.freelifemakers.org\/wordpress\/?p=7715"},"modified":"2026-08-12T11:13:55","modified_gmt":"2026-08-12T02:13:55","slug":"nextjs-dns-caddy","status":"publish","type":"post","link":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/2026\/08\/10\/nextjs-dns-caddy\/","title":{"rendered":"[nextjs]nextjs+domain(ddns)+https(caddy)"},"content":{"rendered":"\n<p>\ud83d\udc49\ud83c\udffb Nextjs\uc124\uc815 \ud504\ub85c\uc81d\ud2b8 \uc2dc\uc791\uacfc \ud568\uaed8 \uc5ec\ub7ec\ubd84\uc758 \ub85c\uceec PC\uc5d0 https\uc124\uc815\uc744 \ud569\ub2c8\ub2e4.<br>As part of the Next.js project setup, you will configure HTTPS on your local machine.<\/p>\n\n\n\n<p>\ud83d\udc49\ud83c\udffb  \uc774\uc804\uc5d0\ub294 https\uc124\uc815\uc744 \uc704\ud574\uc11c nginx\uc640 certbot\uc744 \uc124\uce58\ud574\uc11c \uc0ac\uc6a9\ud588\uc2b5\ub2c8\ub2e4.<br>Previously, I installed and used Nginx and Certbot to set up HTTPS.<\/p>\n\n\n\n<p>\ud83d\udc49\ud83c\udffb \uc774\ubc88\uc5d0\ub294 \uac04\ub2e8\ud788 cadddy\ub85c https\ub97c \uad6c\ud604\ud560 \uc608\uc815\uc785\ub2c8\ub2e4.<br>This time, I plan to implement HTTPS using Caddy.<\/p>\n\n\n\n<p><a href=\"https:\/\/caddyserver.com\">https:\/\/caddyserver.com<\/a><\/p>\n\n\n\n<p>\ud83d\udc49\ud83c\udffb \uae30\uc874 \ubc29\uc2dd\ubcf4\ub2e4\ub294 \uc124\uc815\uc774 \ub9e4\uc6b0 \uac04\ud3b8\ud558\uae30 \ub54c\ubb38\uc5d0 \uc791\uc740 \ud504\ub85c\uc81d\ud2b8\ub294 cadddy\ub97c \ucd94\ucc9c\ud569\ub2c8\ub2e4.<br>I recommend Caddy for small projects because it is much easier to set up than traditional methods.<\/p>\n\n\n\n<p>\ud83d\udc49\ud83c\udffb \uc131\ub2a5\uc774 \uc911\uc694\ud55c \uacf3\uc740 Nginx+Certbot\uc744 \uc0ac\uc6a9\ud558\uc2dc\uace0 \uac04\ub2e8\ud55c \ud504\ub85c\uc81d\ud2b8\ub294 caddy\ub97c \uc0ac\uc6a9\ud558\uc2dc\uba74\ub429\ub2c8\ub2e4.<br>\uc131\ub2a5\uc774 \uc911\uc694\ud55c \uacf3\uc740 Nginx+Certbot\uc744 \uc0ac\uc6a9\ud558\uc2dc\uace0 \uac04\ub2e8\ud55c \ud504\ub85c\uc81d\ud2b8\ub294 caddy\ub97c \uc0ac\uc6a9\ud558\uc2dc\uba74\ub429\ub2c8\ub2e4.<\/p>\n\n\n\n<p>\ud83d\udc49\ud83c\udffb \ub3c4\uba54\uc778\uc740 DDNS\ub97c \uc0ac\uc6a9\ud569\ub2c8\ub2e4.<br>The domain uses DDNS.<\/p>\n\n\n\n<p>\ud83d\udcc1 Nextjs \ud504\ub85c\uc81d\ud2b8 \uc0dd\uc131<br>Create a Next.js project<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npx create-next-app@latest<\/code><\/pre>\n\n\n\n<p>\ud83d\udcc1 \ub3c4\uba54\uc778 \ud5c8\uc6a9 \/ Allow Domain<\/p>\n\n\n\n<p>&#8212; next.config.ts\uc5d0 \uc544\ub798\ucc98\ub7fc \ub3c4\uba54\uc778\uc744 \ud5c8\uc6a9\ud569\ub2c8\ub2e4.<br>Allow the domain in <code>next.config.ts<\/code> as shown below.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import type { NextConfig } from \"next\";\n\nconst nextConfig: NextConfig = {\n  \/* config options here *\/\nallowedDevOrigins: &#91;<strong>'host.yourdomain.org', '*.yourdomain.org<\/strong>'],\n};\n\nexport default nextConfig;<\/code><\/pre>\n\n\n\n<p>\ud83d\udcc1 https\uc124\uc815 \/ HTTPS configuration<\/p>\n\n\n\n<p>\u2714\ufe0f macOS<\/p>\n\n\n\n<p>&#8212; Caddy\ub294 \ubc94\uc6a9 \uc6f9\uc11c\ubc84\ub85c ngin\ubcf4\ub2e4\ud6e8\uc52c \uc27d\uac8c https\uc124\uc815\uc744 \ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<br>Caddy is a general-purpose web server that makes setting up HTTPS much easier than Nginx.<\/p>\n\n\n\n<p>&#8212; Caddy\uac00 80\uc73c\ub85c \uc811\uc18d\ud558\uba74 3000\ud3ec\ud2b8\ub85c \ud3ec\uc6cc\ub529 \ud574\uc90d\ub2c8\ub2e4.<br>When Caddy receives a request on port 80, it forwards it to port 3000.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>brew install caddy<\/code><\/pre>\n\n\n\n<p>&#8212; Caddy file \ub9cc\ub4e4\uae30(myapp11 \ud504\ub85c\uc81d\ud2b8\ub0b4  )<br>Create a Caddyfile (within the myapp11 project)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \ud30c\uc77c\uc5f4\uae30 \/ Open File\nnano Caddyfile\n\n# \uc124\uc815 \uc791\uc131 \/ Create Configuration\naloy-horizon.duckdns.org {\n    reverse_proxy localhost:3000\n}\n\n#\ud30c\uc77c \uc800\uc815\ud6c4 \uc885\ub8cc \/ Save file and exit (Ctrl + O,Ctrl + x)<\/code><\/pre>\n\n\n\n<p>&#8212; Caddy \uc2e4\ud589 \/ Run Caddy<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>caddy fmt --overwrite Caddyfile\ncaddy run\n\n# background\n\ncaddy start\ncaddy stop\n\n# \uc7ac\ubd80\ud305\uc2dc\uc5d0\ub3c4 \uc801\uc6a9\ud558\ub824\uba74\n# To apply the setting even after rebooting\n\nbrew services start caddy\nbrew services stop caddy<\/code><\/pre>\n\n\n\n<p>\u2714\ufe0f Linux<\/p>\n\n\n\n<p>&#8212; Caddy \uc124\uce58 \/ Installing Caddy<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl\n\ncurl -1sLf 'https:\/\/dl.cloudsmith.io\/public\/caddy\/stable\/gpg.key' | sudo gpg --dearmor -o \/usr\/share\/keyrings\/caddy-stable-archive-keyring.gpg\n\ncurl -1sLf 'https:\/\/dl.cloudsmith.io\/public\/caddy\/stable\/debian.deb.txt' | sudo tee \/etc\/apt\/sources.list.d\/caddy-stable.list\n\nsudo apt update\nsudo apt install caddy<\/code><\/pre>\n\n\n\n<p>&#8212; Caddy \uc2e4\ud589 \/ Run Caddy<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\n# \nsudo mv Caddyfile \/etc\/caddy\/Caddyfile\nsudo nano \/etc\/caddy\/Caddyfile\n\n host.yourdomain.org {\n     reverse_proxy localhost:3000\n }\n\nsudo systemctl enable --now caddy\nsudo systemctl status caddy<\/code><\/pre>\n\n\n\n<p>\ud83d\udcc1 \ube0c\ub77c\uc6b0\uc800 \uc811\uc18d \/ Access Browser<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"676\" src=\"https:\/\/www.freelifemakers.org\/wordpress\/wp-content\/uploads\/2026\/08\/myapp11-2-1024x676.jpg\" alt=\"\" class=\"wp-image-7790\" srcset=\"https:\/\/www.freelifemakers.org\/wordpress\/wp-content\/uploads\/2026\/08\/myapp11-2-1024x676.jpg 1024w, https:\/\/www.freelifemakers.org\/wordpress\/wp-content\/uploads\/2026\/08\/myapp11-2-300x198.jpg 300w, https:\/\/www.freelifemakers.org\/wordpress\/wp-content\/uploads\/2026\/08\/myapp11-2-768x507.jpg 768w, https:\/\/www.freelifemakers.org\/wordpress\/wp-content\/uploads\/2026\/08\/myapp11-2-1536x1014.jpg 1536w, https:\/\/www.freelifemakers.org\/wordpress\/wp-content\/uploads\/2026\/08\/myapp11-2-400x264.jpg 400w, https:\/\/www.freelifemakers.org\/wordpress\/wp-content\/uploads\/2026\/08\/myapp11-2-800x528.jpg 800w, https:\/\/www.freelifemakers.org\/wordpress\/wp-content\/uploads\/2026\/08\/myapp11-2.jpg 1582w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">host.yourdomain.org<\/figcaption><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\ud83d\udc49\ud83c\udffb Nextjs\uc124\uc815 \ud504\ub85c\uc81d\ud2b8 \uc2dc\uc791\uacfc \ud568\uaed8 \uc5ec\ub7ec\ubd84\uc758 \ub85c\uceec PC\uc5d0 https\uc124\uc815\uc744 \ud569\ub2c8\ub2e4.As part of the Next.js project setup, you will configure HTTPS on your local machine. \ud83d\udc49\ud83c\udffb \uc774\uc804\uc5d0\ub294 https\uc124\uc815\uc744 \uc704\ud574\uc11c nginx\uc640 certbot\uc744 \uc124\uce58\ud574\uc11c \uc0ac\uc6a9\ud588\uc2b5\ub2c8\ub2e4.Previously, I installed and used Nginx and Certbot to set up HTTPS. \ud83d\udc49\ud83c\udffb \uc774\ubc88\uc5d0\ub294 \uac04\ub2e8\ud788 cadddy\ub85c https\ub97c \uad6c\ud604\ud560 \uc608\uc815\uc785\ub2c8\ub2e4.This time, I plan to implement [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27,1,7],"tags":[],"class_list":["post-7715","post","type-post","status-publish","format-standard","hentry","category-nextjs","category-uncategorized","category-website","missing-thumbnail"],"_links":{"self":[{"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/7715","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/comments?post=7715"}],"version-history":[{"count":55,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/7715\/revisions"}],"predecessor-version":[{"id":7807,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/7715\/revisions\/7807"}],"wp:attachment":[{"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/media?parent=7715"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/categories?post=7715"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/tags?post=7715"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}