<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hant">
	<id>https://wiki.hhpeng.org/history/Caddy?feed=atom</id>
	<title>Caddy - 修訂紀錄</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.hhpeng.org/history/Caddy?feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.hhpeng.org/history/Caddy"/>
	<updated>2026-10-25T18:18:31Z</updated>
	<subtitle>本 wiki 上此頁面的修訂紀錄</subtitle>
	<generator>MediaWiki 1.45.0</generator>
	<entry>
		<id>https://wiki.hhpeng.org/index.php?title=Caddy&amp;diff=131&amp;oldid=prev</id>
		<title>Hsins：​建立內容為「== 安裝 == &lt;syntaxhighlight lang=&quot;aspectj&quot;&gt; # Install from Official Repository $ apt install -y debian-keyring debian-archive-keyring apt-transport-https curl $ curl -1sLf &#039;https://dl.cloudsmith.io/public/caddy/stable/gpg.key&#039; | gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg $ curl -1sLf &#039;https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt&#039; | tee /etc/apt/sources.list.d/caddy-stable.list $ chmod o+r /usr/share/keyrings/caddy-…」的新頁面</title>
		<link rel="alternate" type="text/html" href="https://wiki.hhpeng.org/index.php?title=Caddy&amp;diff=131&amp;oldid=prev"/>
		<updated>2025-12-26T08:14:19Z</updated>

		<summary type="html">&lt;p&gt;建立內容為「== 安裝 == &amp;lt;syntaxhighlight lang=&amp;quot;aspectj&amp;quot;&amp;gt; # Install from Official Repository $ apt install -y debian-keyring debian-archive-keyring apt-transport-https curl $ curl -1sLf &amp;#039;https://dl.cloudsmith.io/public/caddy/stable/gpg.key&amp;#039; | gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg $ curl -1sLf &amp;#039;https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt&amp;#039; | tee /etc/apt/sources.list.d/caddy-stable.list $ chmod o+r /usr/share/keyrings/caddy-…」的新頁面&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新頁面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== 安裝 ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;aspectj&amp;quot;&amp;gt;&lt;br /&gt;
# Install from Official Repository&lt;br /&gt;
$ apt install -y debian-keyring debian-archive-keyring apt-transport-https curl&lt;br /&gt;
$ curl -1sLf &amp;#039;https://dl.cloudsmith.io/public/caddy/stable/gpg.key&amp;#039; | gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg&lt;br /&gt;
$ curl -1sLf &amp;#039;https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt&amp;#039; | tee /etc/apt/sources.list.d/caddy-stable.list&lt;br /&gt;
$ chmod o+r /usr/share/keyrings/caddy-stable-archive-keyring.gpg&lt;br /&gt;
$ chmod o+r /etc/apt/sources.list.d/caddy-stable.list&lt;br /&gt;
$ apt update&lt;br /&gt;
$ apt install caddy&lt;br /&gt;
&lt;br /&gt;
# Replace with compiled version&lt;br /&gt;
$ xcaddy build --with [...]&lt;br /&gt;
&lt;br /&gt;
$ systemctl stop caddy&lt;br /&gt;
$ cp /usr/bin/caddy /usr/bin/caddy.bak&lt;br /&gt;
$ cp ~/caddy /usr/bin/caddy&lt;br /&gt;
$ chmod 755 /usr/bin/caddy&lt;br /&gt;
$ setcap cap_net_bind_service=+ep /usr/bin/caddy&lt;br /&gt;
$ apt-mark hold caddy&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 使用 Caddy 搭配 GeoIP 限制地區 ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
demo.example.com {&lt;br /&gt;
    @taiwan {&lt;br /&gt;
        maxmind_geolocation {&lt;br /&gt;
            db_path &amp;quot;/etc/caddy/GeoLite2-Country.mmdb&amp;quot;&lt;br /&gt;
            allow_countries TW&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    handle @taiwan {&lt;br /&gt;
        reverse_proxy https://demo.example.com {&lt;br /&gt;
            header_up Host demo.example.com&lt;br /&gt;
            header_up X-Real-IP {remote_host}&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    handle {&lt;br /&gt;
        respond &amp;quot;Access Denied&amp;quot; 403&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hsins</name></author>
	</entry>
</feed>