åæãšæ³šæäºé
- Ubuntu22.04 ã§ã®äœæ¥ãåæãšããŠããŸãã
- Tailscale ã«åå ããŠãã Ubuntu ãåæãšããŠããŸãããä»ã® VPN ã LAN ç°å¢ ã§ãåæ§ã®ããšãã§ãããšæããŸãã
- Google Domains ã§ååŸããç¬èªãã¡ã€ã³ã䜿ããŸãããCaddy ã察å¿ããŠããã°ä»ã® DNS ãããã€ãã§ãåæ§ã®ããšãã§ããŸãã
- Go èšèªã®å®è¡ç°å¢ãå¿ èŠã§ãã
ãã®èšäºã®ãŽãŒã«
以äžã®ãããªãããã¯ãŒã¯ã§ãèªåãæã€ç¬èªãã¡ã€ã³ïŒexample.com
ãšããŸããïŒãšãã®ãµããã¡ã€ã³ã䜿ã£ãŠ Tailscale ãããã¯ãŒã¯å
ã§åããŠãããµãŒãã¹ã«ã¢ã¯ã»ã¹ã§ããããã«ãããšãããŸã§ããŽãŒã«ãšããŸãã
ãã®èšäºã§ã¯ãTailscale ã䜿ã£ããããã¯ãŒã¯ãšããŠããŸãããZeroTier ãªã©ã® VPNãä»ã®éãããããã¯ãŒã¯ã§ãåæ§ã®ããšãã§ãããšæããŸãã
äžèšã®ãããã¯ãŒã¯ã€ã¡ãŒãžå³ã®ããã«ãè€æ°ã®ãµãŒãã¹ïŒNextcloudãcode-server ãªã©ïŒãïŒã€ã®ãµãŒãäžã§ Docker ã䜿ã£ãŠåäœããŠãããšããŸãã
ãããã®ãµãŒãã¹ã¯ç°ãªãããŒãçªå·ã䜿ã£ãŠã¢ã¯ã»ã¹ã§ããããã«ãªã£ãŠãããããäŸãã°ãã©ãŠã¶ã§ Tailscale äžã® IP ã¢ãã¬ã¹ãšããŒãçªå·ã䜿ã£ãŠhttp://100.100.100.1:8080
ã®ããã«ä»ã® Tailscale 端æ«ããã¢ã¯ã»ã¹ã§ããç¶æ
ã§ãã
ãã ãã®ãŸãŸã ãšä»¥äžã®åé¡ããããŸãã
- ãµãŒãã¹ãå¢ãã床ã«ã©ã®ããŒãçªå·ãã©ã®ãµãŒãã¹ã«å¯Ÿå¿ããŠããããèŠããŠããå¿ èŠããããIP ã¢ãã¬ã¹ãšããŒãçªå·ãèŠããŠããªããšã¢ã¯ã»ã¹ã§ããªãã®ã§äœ¿ãåæã倧å€æªãã
https
ã§ã®ã¢ã¯ã»ã¹ãå¿ é ã®ãµãŒãã¹ã®å Žåã¯èªå·±èšŒææžã䜿ãå¿ èŠããããŸããããããèªå·±èšŒææžã®ååŸãæŽæ°ã®å¯Ÿå¿ãå¿ èŠã«ãªãæéããããã
ããã§ãèŠããããç¬èªãã¡ã€ã³ãšãµããã¡ã€ã³ãå²ãåœãŠãããã« SSL 蚌ææžã®çºè¡ãšæŽæ°ãèªååããããšã§ããã䜿ãåæã®è¯ãç°å¢ãæ§ç¯ããŸãã
äŸãã°ãnextcloud.example.com
ãcode.example.com
ã®ãããªãµããã¡ã€ã³ãå²ãåœãŠãhttps://nextcloud.example.com
ãhttps://code.example.com
ã®ããã«ã¢ã¯ã»ã¹ã§ããããã«ããŸãã
ãã¡ããããã£ãšã·ã³ãã«ãªnx.example.com
ãå²ãåœãŠãŠã OK ã§ãã奜ããªãµããã¡ã€ã³ã䜿çšã§ããŸãã
ãããŠãã®å®çŸã®ããã« Caddy ã䜿ããŸãã
äžèšã®ãããã¯ãŒã¯å³ã§ã¯ããªãŒã¢ã€ã³ã³ãº æ§ã®ã¢ã€ã³ã³ã䜿çšããŠããŸãã
Caddy ã«ã€ããŠ
Web ãµãŒããšèšãã° Apache ã Nginx ãã¡ãžã£ãŒã§ãããCaddy ã Web ãµãŒãã®ïŒã€ã§ãã Caddy 㯠Nginx ã Apache ã®ããã«å€§éã®ãã©ãã£ãã¯æãããšãç®çãšãã Web ãµãŒãã§ã¯ãªããå°èŠæš¡ãª Web ãµãŒããæ§ç¯ããããšãç®çãšããŠããŸãã 以äžã Caddy ã®å ¬åŒãµã€ããšãªããžããªã«ãªããŸãã
Caddy ã®æ倧ã®ç¹åŸŽã¯ãSSL 蚌ææžã®èªå管çã§ããACME æšæºã§ã® SSL 蚌ææžã®ååŸæ¹æ³ãšããŠã¡ãžã£ãŒãª http-01 ãã£ã¬ã³ãžã dns-01 ãã£ã¬ã³ãžãå°ãªããã DNS ã¬ã³ãŒãã®è¿œå ãªã©ã®æäœæ¥ãå¿ èŠã§ãã ãããã®äœæ¥ã Caddy ã¯èªåã§è¡ãããšãã§ããŸãã åèã« Let's Encrypt ã®å ¬åŒãµã€ãã«ãèšèŒãããŠãããã£ã¬ã³ãžã®çš®é¡ã«ã€ããŠä»¥äžã«ãªã³ã¯ãèŒããŸãã
ãã£ã¬ã³ãžã®çš®é¡
Letâs Encrypt ãã蚌ææžãååŸãããšãã«ã¯ãACME æšæºã§å®çŸ©ãããŠããããã£ã¬ã³ãžãã䜿çšããŠã蚌ææžã蚌æããããšããŠãããã¡ã€ã³åãããªãã®å¶åŸ¡äžã«ããããšãæ€èšŒããŸãã
letsencrypt.org
äœæ¥ã®æµã
以äžãæµãã«ãªããŸãã
- Caddy ã Ubuntu ã«ã€ã³ã¹ããŒã«ãã
- xcaddy ã Ubuntu ã«ã€ã³ã¹ããŒã«ãã
- xcaddy ãš caddy-dns 䜿ã£ãŠã¯ã€ã«ãã«ãŒã蚌ææžã®èªåååŸã«å¯Ÿå¿ãã Caddy ããã«ããã
- DNS ãããã€ãã§ãµãŒãã® Tailscale ã® IP ã¢ãã¬ã¹ã®ã¬ã³ãŒããè¿œå ãã
- Google Domains ã®ã¢ã¯ã»ã¹ããŒã¯ã³ãååŸãã
- Caddyfile ãäœæãã
- åäœç¢ºèªãã
Caddy ã Ubuntu ã«ã€ã³ã¹ããŒã«ãã
以äžã®å ¬åŒããã¥ã¡ã³ãã«åŸã£ãŠã€ã³ã¹ããŒã«ãè¡ããŸãã ããã§ã¯ãCaddy ã Ubuntu22.04 ã«ã€ã³ã¹ããŒã«ããŸãã 以äžã®ã³ãã³ããå®è¡ããŸãã
$ sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
$ curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
$ curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
$ sudo apt update
$ sudo apt install caddy
äžèšãå®è¡åŸãcaddy
ã³ãã³ãã§ããŒãžã§ã³ã確èªã§ããã°æ£åžžã«ã€ã³ã¹ããŒã«å®äºã§ãã
$ caddy -v
v2.7.5 h1:HoysvZkLcN2xJExEepaFHK92Qgs7xAiCFydN5x5Hs6Q=
Caddy ãèµ·åãã
以äžã®ã³ãã³ãã§èµ·åããŸããå®è¡ãããšä»¥äžã®ããã«è¡šç€ºãããŸãã
$ caddy run
2023/11/14 10:19:32.041 INFO admin admin endpoint started {"address": "localhost:2019", "enforce_origin": false, "origins": ["//127.0.0.1:2019", "//localhost:2019", "//[::1]:2019"]}
2023/11/14 10:19:32.042 INFO serving initial configuration
äžèšã®ããã«run
ã䜿ããšããã¯ã°ã©ãŠã³ãã§ã®å®è¡ã§ã¯ãªããããã«ãã°ã衚瀺ããç¶ããŸãããã£ãŠåäœç¢ºèªæã«run
ã䜿ãã®ãè¯ãã§ãã
ããããã¯ã°ã©ã³ãã§èµ·åãããå Žåã¯start
ã䜿çšããŸãã
$ caddy start
åæ¢ããæã¯stop
ã䜿çšããŸãã
$ caddy stop
ãªããŒã¹ãããã·ã®ããã®èšå®ãå®éã®åäœç¢ºèªã¯åŸè¿°ããŸãã
åäœç¢ºèª
Caddy ãèµ·åããã Web ãµãŒããšããŠã®åäœã確èªããŸããè©Šãã« Caddy ãèµ·åããç¶æ
ã§ããã©ãŠã¶ã§http://localhost:2015
ã«ã¢ã¯ã»ã¹ããŠã¿ãŸãã以äžã®ããã«è¡šç€ºãããã° OK ã§ãã
$ curl http://localhost:2015
Hello, World!
xcaddy ã Ubuntu ã«ã€ã³ã¹ããŒã«ãã
Caddy ã®ã¢ãžã¥ãŒã«ãç°¡åã«ã€ã³ã¹ããŒã«ããããã®ããŒã«ãšããŠxcaddy
ãããã®ã§ãããã€ã³ã¹ããŒã«ããŸãã
以äžã®æé ã«åŸããŸããCaddy å
¬åŒããã¥ã¡ã³ãã«åŸã£ãŠxcaddy
ãã€ã³ã¹ããŒã«ããŸãã
ãªããxcaddy
ã®ã€ã³ã¹ããŒã«ãšåäœã«ã¯ãGo èšèªã®å®è¡ç°å¢ãå¿
èŠã§ãã
ãŸã Go ç°å¢ã®å®è¡ç°å¢ããªãå Žåã¯ãå
ã« Go ãã€ã³ã¹ããŒã«ããŠãã ããã
以äžãå®è¡ããŸãã
$ sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
$ curl -1sLf 'https://dl.cloudsmith.io/public/caddy/xcaddy/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-xcaddy-archive-keyring.gpg
$ curl -1sLf 'https://dl.cloudsmith.io/public/caddy/xcaddy/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-xcaddy.list
$ sudo apt update
$ sudo apt install xcaddy
以äžã§xcaddy
ã®ã€ã³ã¹ããŒã«ã¯å®äºã§ãã
xcaddy ãš caddy-dns 䜿ã£ãŠã¯ã€ã«ãã«ãŒã蚌ææžã®èªåååŸã«å¯Ÿå¿ãã Caddy ããã«ããã
caddy-dns ã«ã€ããŠ
ã¯ã€ã«ãã«ãŒã蚌ææžã®ååŸãèªååããããã«ãCaddy ãå
¬åŒã«æäŸããŠããcaddy-dns
ãšããã¢ãžã¥ãŒã«ãå©çšããŸãã
caddy-dns
Caddy modules that automate manipulation of DNS records (built on libdns interfaces)
github.com
caddy-dns
ã䜿ãããšã§ãã¯ã€ã«ãã«ãŒã蚌ææžã®ååŸæã«å¿
èŠãšãªãdns-01ãã£ã¬ã³ãž
ãèªååã§ããŸãã
ãªããã¯ã€ã«ãã«ãŒã蚌ææžãäžèŠãªå Žåã¯dns-01ãã£ã¬ã³ãž
ã®ä»ã«http-01ãã£ã¬ã³ãž
ã䜿ããŸããCaddy ã¯http-01ãã£ã¬ã³ãž
ã察å¿ããŠããèªåã§è¡ãããšãã§ããŸãã
ãã ããhttp-01ãã£ã¬ã³ãž
ãå®äºãããã«ã¯ãå®åšãã IP
ã¢ãã¬ã¹ã«èªèšŒå±ãã¢ã¯ã»ã¹ã§ããå¿
èŠããããŸãã
ãã®å ŽåãäŸãã°ç€Ÿå
ãããã¯ãŒã¯ããä»ã«ã¯ Tailscale ã®ãã㪠VPN
ã®éãããããã¯ãŒã¯å
ã«ãããµãŒãã® IP
ã¢ãã¬ã¹ã¯å€éšããã¢ã¯ã»ã¹ããããšãã§ããªãããhttp-01ãã£ã¬ã³ãž
ãæåãããããšãã§ããŸããã
ãã®ãããã®ãããªå Žåã¯dns-01ãã£ã¬ã³ãž
ã䜿ããŸãã
caddy-dnsã察å¿ããŠããDNSãããã€ãã«ã€ããŠ
caddy-dns
ã«ã¯ãDNSãããã€ãæ¯ã®ã¢ãžã¥ãŒã«ãçšæãããŠããŸãã
äŸãã°ãä»å㯠Google Domains
ã§ååŸãããã¡ã€ã³ã䜿ãã®ã§ãcaddy-dns/google-domains
ã䜿ããŸãã
caddy-dns/google-domains
ã䜿ãããšã§ãGoogle Domains ã® DNS
ã¬ã³ãŒããèªåã§æŽæ°ããããšãã§ããŸãã
以äžã®ç»åã®ããã«caddy-dns
ã®ãªããžããªã«ãŠå¯Ÿå¿ããŠãããã¡ã€ã³
ãããã€ãã®ã¢ãžã¥ãŒã«ã確èªã§ããŸãã cloudflare
ã AWS
ã®route53
ãªã©ã®äžççã«ã¡ãžã£ãŒãªãµãŒãã¹ã¯ã¢ãžã¥ãŒã«ãçšæãããŠããŸãã
æ®å¿µãªãã Google Domains 㯠Squarespace
瀟ã«ãã¡ã€ã³äºæ¥ã売åŽããããšãçºè¡šãããŠãããããcaddy-dns/google-domains
èªäœã¯ãã§ã«public archive
ã«ãªã£ãŠããŸãããèšäºå
¬éæç¹ã§ã¯åŒãç¶ã䜿çšã§ããŸãã ãããããã
Squarespace 瀟çšã®ãã¢ãžã¥ãŒã«ããã®ãã¡æäŸãããã®ã§ã¯ãªãããšæããŸãã
xcaddy ã䜿ã£ãŠ caddy-dns ãçµã¿èŸŒãã Caddy ããã«ããã
xcaddy
ãšcaddy-dns/google-domains
ã䜿ã£ãŠãGoogle Domains ã®æäœã API çµç±ã§å®è¡ããŠã¯ã€ã«ãã«ãŒã蚌ææžã®ååŸãèªååã§ãã Caddy ããã«ãããŸãã
Google Domains ã§ã¯ãªãä»ã® DNS ãããã€ãã䜿ã£ãŠããå Žåã¯ãcaddy-dns
ã®ãªããžããªã§äœ¿ã£ãŠãã DNS ãããã€ãçšã®ã¢ãžã¥ãŒã«ã確èªããŠä»¥äžã®--with github.com/caddy-dns/google-domains
éšåã眮ãæããŠãã ããã
ãŸããããã§ã¯é©åœãªãã£ã¬ã¯ããªãšããŠ~/caddy-google-domains
ãäœæããããã§ãã«ãããŸãããåèªã®ç°å¢ã«åãããŠä»»æã®ãšããã§å®è¡ããŠãã ããã
$ mkdir ~/caddy-google-domains
$ cd ~/caddy-google-domains
$ xcaddy build --with github.com/caddy-dns/google-domains 2023/11/17 06:24:09 [INFO] Temporary folder: /tmp/buildenv_2023-11-17-0624.2884679400
2023/11/17 06:24:09 [INFO] Writing main module: /tmp/buildenv_2023-11-17-0624.2884679400/main.go
package main
(...çç¥...)
go: downloading cloud.google.com/go/iam v1.1.1
go: downloading golang.org/x/oauth2 v0.12.0
go: downloading cloud.google.com/go/compute v1.23.0
go: downloading github.com/google/s2a-go v0.1.7
2023/11/17 06:25:04 [INFO] exec (timeout=0s): /usr/local/go/bin/go build -o /home/hisui/caddy-google-domai
ns/caddy -ldflags -w -s -trimpath
2023/11/17 06:25:24 [INFO] Build complete: ./caddy
2023/11/17 06:25:24 [INFO] Cleaning up temporary folder: /tmp/buildenv_2023-11-17-0624.635568165
äžèšãæåãããšãäžèšã®ã³ãã³ããå®è¡ãããã£ã¬ã¯ããªã®çŽäžã«caddy
ãšããå®è¡ãã¡ã€ã«ãçæãããŸãã
ãã®caddy
ãcaddy-dns
ãçµã¿èŸŒãã Caddy ã«ãªããããã䜿ã£ãŠã¯ã€ã«ãã«ãŒã蚌ææžã®ååŸã«å¯Ÿå¿ãããªããŒã¹ãããã·ãæ§ç¯ããŸãã
念ã®çºä»¥äžã®ããã«ããŒãžã§ã³ã衚瀺ã§ããããšã確èªããŠã¿ãŠãã ããã
$ ./caddy -v
v2.7.5 h1:HoysvZkLcN2xJExEepaFHK92Qgs7xAiCFydN5x5Hs6Q=
DNS ãããã€ã㧠Tailscale ã® IP ã¢ãã¬ã¹ã®ã¬ã³ãŒããè¿œå ãã
èªåã®ç¬èªãã¡ã€ã³ã® DNS ãããã€ãã®ç®¡çç»é¢ã«ãŠããµãŒãã® Tailscale ã® IP ã¢ãã¬ã¹ïŒæ¬èšäºåé ã®ãããã¯ãŒã¯å³ã®100.100.100.1
ïŒã A ã¬ã³ãŒããšããŠè¿œå ããŸãã
ãŸããåæ§ã« AAAA ã¬ã³ãŒãïŒèšäºåé ã®ç»åå
ã«èšèŒããŠããŸããããTailscale ã®ç®¡çç»é¢ã§ IPv6 ã®ã¢ãã¬ã¹ã確èªã§ããŸããïŒãè¿œå ããŸãã
ãã®æé ã¯äœ¿çšããŠãã DNS ãããã€ãã«ãã£ãŠç°ãªããŸããã以äžã®å
容ã®ã¯ã€ã«ãã«ãŒãã® A ã¬ã³ãŒããš AAAA ã¬ã³ãŒããè¿œå ããŸãã
# Aã¬ã³ãŒã
ãã¹ãå: *.example.com
ã¿ã€ã: A
TTL: 1æé
å€: 100.100.100.1
# AAAAã¬ã³ãŒã
ãã¹ãå: *.example.com
ã¿ã€ã: AAAA
TTL: 1æé
å€: 2001:0ab8:91a3:0000:0000:8a2e:0370:7334
äžèšãè¿œå ããããšã§ãåã Tailscale ã®ãããã¯ãŒã¯ã«åå ããŠãã端æ«ãªãã°ãexample.com
ã®åå解決å
ã Tailscale å
ã®ãµãŒããšãªããŸãã
ãªããTailscale ã® IP ã¢ãã¬ã¹ããããªãã¯ãª A ã¬ã³ãŒããš AAAA ã¬ã³ãŒããšããŠç»é²ããããšã«ã€ããŠã¯ç¹ã«å®³ã¯ãªããšãã趣æšã®èª¬æ㯠Tailscale ã®å ¬åŒããã¥ã¡ã³ãã«ããããŸãããããæ°ã«ãªãå Žåã¯ä»¥äžã®èšäºãåèã«ããŠãã ããã
Using a public DNS subdomain
If youâd prefer not to manage DNS settings via the admin console, you can instead publish records on your public-facing DNS server, assuming you have one.
tailscale.com
Google Domains ã®ã¢ã¯ã»ã¹ããŒã¯ã³ãååŸãã
次㯠Google Domains ã®ã¢ã¯ã»ã¹ããŒã¯ã³ãååŸããŸãã
ããã®äœæ¥ã¯åèªãååŸããç¬èªãã¡ã€ã³ã® DNS ãããã€ãã«ãã£ãŠæé ãç°ãªããŸãã
Google Domains ã§å Žåã¯ãGoogle Domains ã«ãã°ã€ã³ããŠãµã€ãã¡ãã¥ãŒã«ãããã»ãã¥ãªãã£ããã¯ãªãã¯ããŠéããŸãã
éããããŒãžã®æäžéšã«ãACME DNS APIããšããé
ç®ãããããã®äžã®ãããŒã¯ã³ãäœæããã¯ãªãã¯ããŸãã
ãããŒã¯ã³ãäœæããã¯ãªãã¯ãããšã以äžã®ããã«ããŒã¯ã³ã衚瀺ãããã®ã§ããããŒã³ããŒããŠãããŸãã
ããã§ã³ããŒããã¢ã¯ã»ã¹ããŒã¯ã³ãåŸã»ã©äœ¿çšããŸãã
Caddyfile ãäœæãã
Caddy ã¯ããµãŒããšããŠã®èšå®ãè¡ãæ¹æ³ãããã€ãçšæãããŠããŸããã³ãã³ãã§ãªãã·ã§ã³ãæå®ãããã§ãªããŒã¹ãããã·ãšããŠèµ·åãã§ããŸãã
ããã§ã¯ãCaddyfile
ãšããèšå®ãã¡ã€ã«ã䜿ã£ãŠèšå®ãè¡ããŸãã
ãªããŒã¹ãããã·ãšããŠåäœãããŠã¯ã€ã«ãã«ãŒã蚌ææžãèªåååŸãããããã«Caddyfile
ã以äžã®ããã«ããŸãã
# çµã¿èŸŒãã Google Domainsã®ã¢ãžã¥ãŒã«ã䜿ã
# ã¢ã¯ã»ã¹ããŒã¯ã³ã¯åç¯ã§ååŸãããã®ãæå®ãã
{
acme_dns google_domains Akd9JS129sA9dkASJd9sksjn2A==
}
# code-serverãžã®ãªããŒã¹ãããã·
code.example.com {
reverse_proxy localhost:8080
}
# immichãžã®ãªããŒã¹ãããã·
immich.example.com {
reverse_proxy localhost:2283
}
# nextcloudãžã®ãªããŒã¹ãããã·
nextcloud.example.com {
reverse_proxy localhost:8022
header {
# enable HSTS
Strict-Transport-Security max-age=31536000;
}
}
äžèšã ãã§ã¯ã€ã«ãã«ãŒã SSL 蚌ææžãèªåååŸãããªããŒã¹ãããã·ãšããŠåäœããããã®èšè¿°ã«ãªããŸãã
äžèšã®Caddyfile
ãåæ ãããããã«adapt
ã³ãã³ãã䜿ããŸãã
adapt
ã³ãã³ããå®è¡ãããšãã«ã¬ã³ããã£ã¬ã¯ããªã«ããCaddyfile
ãèªã¿èŸŒãã§èšå®ãåæ ãããŸãã
$ sudo ./caddy adapt
Caddyfile
ãåæ ãããã以äžã§ Caddy ãèµ·åããŸãã
$ sudo ./caddy run
# ãããã¯ããã¯ã°ã©ãŠã³ãã§èµ·åããå Žåã¯ä»¥äž
$ sudo ./caddy start
ããã¯ã°ã©ãŠã³ãã§èµ·åãããšä»¥äžã®ããã«è¡šç€ºãããŸãã
$ sudo ./caddy start
[sudo] username ã®ãã¹ã¯ãŒã:
2023/11/21 13:55:21.874 INFO using adjacent Caddyfile
2023/11/21 13:55:21.878 INFO admin admin endpoint started {"address": "localhost:2019", "enforce_origin": false, "origins": ["//127.0.0.1:2019", "//localhost:2019", "//[::1]:2019"]}
2023/11/21 13:55:21.879 INFO http.auto_https server is listening only on the HTTPS port but has no TLS connection policies; adding one to enable TLS {"server_name": "srv0", "https_port": 443}
2023/11/21 13:55:21.880 INFO http.auto_https enabling automatic HTTP->HTTPS redirects {"server_name": "srv0"}
2023/11/21 13:55:21.879 INFO tls.cache.maintenance started background certificate maintenance {"cache": "0xc000498600"}
2023/11/21 13:55:21.882 INFO tls cleaning storage unit {"description": "FileStorage:/root/.local/share/caddy"}
2023/11/21 13:55:21.884 INFO http enabling HTTP/3 listener {"addr": ":443"}
2023/11/21 13:55:21.885 INFO tls finished cleaning storage units
2023/11/21 13:55:21.885 INFO http.log server running {"name": "srv0", "protocols": ["h1", "h2", "h3"]}
2023/11/21 13:55:21.886 INFO http.log server running {"name": "remaining_auto_https_redirects", "protocols": ["h1", "h2", "h3"]}
2023/11/21 13:55:21.886 INFO http enabling automatic TLS certificate management {"domains": ["cloud.example.com", "code.example.com", "immich.example.com"]}
2023/11/21 13:55:21.889 INFO autosaved config (load with --resume flag) {"file": "/root/.config/caddy/autosave.json"}
2023/11/21 13:55:21.889 INFO serving initial configuration
Successfully started Caddy (pid=2710021) - Caddy is running in the background
Caddy is running in the background
ãšè¡šç€ºãããŠããã°åé¡ãªãèµ·åã§ããŠããŸãã
ããšã¯Caddyfile
ã§èšè¿°ããhttps://code.example.com
ãhttps://nextcloud.example.com
ã«ãã©ãŠã¶ããã¢ã¯ã»ã¹ã§ããã°æ£åžžã« Caddy ãåäœããŠããããšã確èªã§ããŸãã
ãŸãšã
Caddy ã䜿ãããšã§ãç¬èªãã¡ã€ã³ã®ã¯ã€ã«ãã«ãŒã蚌ææžãèªåååŸããŠãªããŒã¹ãããã·ãšããŠåäœãããããšãã§ããŸããã Caddy ã¯èšå®ãã¡ã€ã«ã«èšè¿°ããå 容ãå°ãªããŠæžã¿ãSSL 蚌ææžã®èªå管çã«ã察å¿ããŠããããéåžžã«äŸ¿å©ã§ãã ããåãããã« Tailscale ã ZeroTier ãªã©ã䜿ã£ãŠèªåã®ãµãŒãã®ãµãŒãã¹ã«ç¬èªãã¡ã€ã³ã§ã¢ã¯ã»ã¹ãããå Žåã¯ããã² Caddy ã䜿ã£ãŠã¿ãŠãã ããã