﻿{"id":1533,"date":"2020-07-27T20:41:27","date_gmt":"2020-07-27T12:41:27","guid":{"rendered":"https:\/\/www.linuxmi.com\/?p=1533"},"modified":"2020-07-27T20:43:00","modified_gmt":"2020-07-27T12:43:00","slug":"linux-caddy-https","status":"publish","type":"post","link":"https:\/\/www.linuxmi.com\/linux-caddy-https.html","title":{"rendered":"\u5982\u4f55\u5728Linux\u670d\u52a1\u5668\u4e0a\u4f7f\u7528Caddy\u90e8\u7f72HTTPS\u7f51\u7ad9"},"content":{"rendered":"<p>Web\u670d\u52a1\u5668\u662f\u670d\u52a1\u5668\u7aef\u5e94\u7528\u7a0b\u5e8f\uff0c\u65e8\u5728\u5904\u7406\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u4e4b\u95f4\u7684HTTP\u8bf7\u6c42\u3002HTTP\u662f\u6700\u5e7f\u6cdb\u4f7f\u7528\u7684\u57fa\u672c\u7f51\u7edc\u534f\u8bae\u3002<\/p>\n<p>Apache HTTP Server\u5728\u8bbe\u8ba1\u5f53\u4eca\u7684\u7f51\u7edc\u4e2d\u626e\u6f14\u4e86\u91cd\u8981\u89d2\u8272\u3002\u5b83\u5360\u670937.3\uff05\u7684\u5e02\u573a\u4efd\u989d\u3002Nginx\u4ee532.4\uff05\u7684\u5e02\u573a\u4efd\u989d\u540d\u5217\u7b2c\u4e8c\u3002\u5fae\u8f6fIIS\u548cLiteSpeed\u5206\u522b\u6392\u540d\u7b2c\u4e09\u548c\u7b2c\u56db\uff0c\u5e02\u573a\u4efd\u989d\u5206\u522b\u4e3a7.8\uff05\u548c6.9\uff05\u3002<\/p>\n<p>\u6700\u8fd1\uff0c\u6211\u9047\u5230\u4e86\u4e00\u4e2a\u540d\u4e3aCaddy\u7684Web\u670d\u52a1\u5668\u3002\u5f53\u6211\u5c1d\u8bd5\u67e5\u8be2\u5176\u529f\u80fd\u5e76\u5c06\u5176\u90e8\u7f72\u5230\u6d4b\u8bd5\u4e2d\u65f6\uff0c\u53ef\u4ee5\u8bf4\u5f88\u68d2\u5f88\u68d2\u3002\u53ef\u79fb\u690d\u7684Web\u670d\u52a1\u5668\uff0c\u4e0d\u9700\u8981\u4efb\u4f55\u914d\u7f6e\u6587\u4ef6\u3002\u6211\u8ba4\u4e3a\u8fd9\u662f\u4e00\u4e2a\u975e\u5e38\u9177\u7684\u9879\u76ee\uff0c\u5e76\u5e0c\u671b\u4e0e\u60a8\u5206\u4eab\u3002\u5728\u672c\u6587\uff0c\u6211\u4eec\u4e0e\u5927\u5bb6\u4e00\u8d77\u5c1d\u8bd5\u4e0bCaddy\uff01<\/p>\n<p><strong>Caddy\u662f\u4ec0\u4e48\uff1f<\/strong><\/p>\n<p>Caddy\u662f\u6613\u4e8e\u914d\u7f6e\u548c\u4f7f\u7528\u7684Apache Web\u670d\u52a1\u5668\u7684\u66ff\u4ee3\u4ea7\u54c1\u3002Caddy\u7684\u9879\u76ee\u8d1f\u8d23\u4ebaMatthew Holt\u58f0\u79f0Caddy\u662f\u4e00\u79cd\u901a\u7528\u7684\u7f51\u7edc\u670d\u52a1\u5668\uff0c\u58f0\u79f0\u662f\u6700\u4eba\u6027\u5316\u7684\u8bbe\u8ba1\uff0c\u5e76\u4e14\u53ef\u80fd\u662f\u552f\u4e00\u7684\u6b64\u7c7b\u670d\u52a1\u5668\u3002<\/p>\n<p>Caddy\u662f\u552f\u4e00\u4e00\u4e2a\u53ef\u4ee5\u4f7f\u7528Let&#8217;s Encrypt\u81ea\u52a8\u83b7\u53d6\u548c\u66f4\u65b0SSL\/TLS\u8bc1\u4e66\u7684Web\u670d\u52a1\u5668\u3002<\/p>\n<p><strong>Caddy\u7684\u7279\u70b9<\/strong><\/p>\n<ul>\n<li>\u4f7f\u7528HTTP\/2\u7684\u5feb\u901fHTTP\u8bf7\u6c42\u3002<\/li>\n<li>\u5177\u6709\u6700\u5c11\u914d\u7f6e\u548c\u65e0\u5fe7\u90e8\u7f72\u7684\u529f\u80fd\u5f3a\u5927\u7684Web\u670d\u52a1\u5668\u3002<\/li>\n<li>TLS\u52a0\u5bc6\u53ef\u786e\u4fdd\u901a\u8fc7Internet\u8fdb\u884c\u901a\u4fe1\u7684\u5e94\u7528\u7a0b\u5e8f\u548c\u7528\u6237\u4e4b\u95f4\u7684\u52a0\u5bc6\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528\u81ea\u5df1\u7684\u5bc6\u94a5\u548c\u8bc1\u4e66\u3002<\/li>\n<li>\u6613\u4e8e\u90e8\u7f72\/\u4f7f\u7528\u3002\u4ec5\u4e00\u4e2a\u6587\u4ef6\uff0c\u4e0d\u4f9d\u8d56\u4efb\u4f55\u5e73\u53f0\u3002<\/li>\n<li>\u65e0\u9700\u5b89\u88c5\u3002<\/li>\n<li>\u4fbf\u643a\u5f0f\u53ef\u6267\u884c\u6587\u4ef6\u3002<\/li>\n<li>\u8fd0\u884c\u591a\u4e2aCPU \/\u5185\u6838\u3002<\/li>\n<li>\u5148\u8fdb\u7684WebSockets\u6280\u672f\u2013\u6d4f\u89c8\u5668\u548c\u670d\u52a1\u5668\u4e4b\u95f4\u7684\u4ea4\u4e92\u5f0f\u901a\u4fe1\u4f1a\u8bdd\u3002<\/li>\n<li>\u670d\u52a1\u5668Markdown\u6587\u6863\u6b63\u5728\u8fd0\u884c\u4e2d\u3002<\/li>\n<li>\u5b8c\u5168\u652f\u6301\u6700\u65b0\u7684IPv6\u3002<\/li>\n<li>\u4ee5\u81ea\u5b9a\u4e49\u683c\u5f0f\u521b\u5efa\u65e5\u5fd7\u3002<\/li>\n<li>\u670d\u52a1FastCGI\uff0c\u53cd\u5411\u4ee3\u7406\uff0c\u91cd\u5199\u548c\u91cd\u5b9a\u5411\uff0c\u5e72\u51c0URL\uff0cGzip\u538b\u7f29\uff0c\u76ee\u5f55\u6d4f\u89c8\uff0c\u865a\u62df\u4e3b\u673a\u548c\u6807\u9898\u3002<\/li>\n<li>\u9002\u7528\u4e8e\u6240\u6709\u5df2\u77e5\u5e73\u53f0\u2013 Windows\uff0cLinux\uff0cBSD\uff0cMac\uff0cAndroid\u3002<\/li>\n<\/ul>\n<p><strong>\u662f\u4ec0\u4e48\u8ba9Caddy\u4e0e\u4f17\u4e0d\u540c\uff1f<\/strong><\/p>\n<ul>\n<li>Caddy\u9644\u5e26\u4e86\u6700\u65b0\u529f\u80fd-HTTP\/2\uff0cIPv6\uff0cMarkdown\uff0cWebSockets\uff0cFastCGI\uff0c\u6a21\u677f\u548c\u5176\u4ed6\u73b0\u6210\u7684\u529f\u80fd\u3002<\/li>\n<li>\u65e0\u9700\u5b89\u88c5\u5373\u53ef\u8fd0\u884c\u53ef\u6267\u884c\u6587\u4ef6\u3002<\/li>\n<li>\u5177\u6709\u6700\u5c11\u6280\u672f\u63cf\u8ff0\u7684\u8be6\u7ec6\u6587\u6863\u3002<\/li>\n<li>\u5f00\u53d1\u65f6\u4f1a\u8003\u8651\u8bbe\u8ba1\u5e08\uff0c\u5f00\u53d1\u4eba\u5458\u548cBlogger\u7684\u9700\u6c42\u5e76\u4f7f\u5176\u8f7b\u677e\u5165\u95e8\u3002<\/li>\n<li>\u652f\u6301\u865a\u62df\u4e3b\u673a\u2013\u5b9a\u4e49\u4efb\u610f\u6570\u91cf\u7684\u7ad9\u70b9\u3002<\/li>\n<li>\u9002\u5408\u60a8\u2013\u65e0\u8bba\u60a8\u7684\u7ad9\u70b9\u662f\u9759\u6001\u7684\u8fd8\u662f\u52a8\u6001\u7684\u3002\u5982\u679c\u60a8\u662f\u4eba\u7c7b\uff0c\u90a3\u662f\u7ed9\u60a8\u7684\u3002<\/li>\n<li>\u60a8\u4e13\u6ce8\u4e8e\u5b9e\u73b0\u76ee\u6807\uff0c\u800c\u4e0d\u662f\u5b9e\u73b0\u76ee\u6807\u3002<\/li>\n<li>\u652f\u6301\u5927\u591a\u6570\u5e73\u53f0\u2013 Windows\uff0cLinux\uff0cMac\uff0cAndroid\uff0cBSD\u3002<\/li>\n<li>\u901a\u5e38\uff0c\u6bcf\u4e2a\u7ad9\u70b9\u6709\u4e00\u4e2aCaddy\u6587\u4ef6\u3002<\/li>\n<li>\u5373\u4f7f\u60a8\u662f\u521d\u5b66\u8005\uff0c\u4e5f\u53ef\u4ee5\u5728\u4e0d\u52301\u5206\u949f\u7684\u65f6\u95f4\u5185\u5b8c\u6210\u8bbe\u7f6e\u3002<\/li>\n<\/ul>\n<p><strong>\u6d4b\u8bd5\u73af\u5883<\/strong><\/p>\n<p>\u6211\u5c06\u5728CentOS\u670d\u52a1\u5668\u548cDebian Server \u4e0a\u5bf9\u5176\u8fdb\u884c\u6d4b\u8bd5\uff0c\u4f46\u662f\u76f8\u540c\u7684\u8bf4\u660e\u4e5f\u9002\u7528\u4e8e\u57fa\u4e8eRHEL\u548cDebian\u7684\u53d1\u884c\u7248\u3002\u5bf9\u4e8e\u8fd9\u4e24\u4e2a\u670d\u52a1\u5668\uff0c\u6211\u5c06\u4f7f\u752864\u4f4d\u53ef\u6267\u884c\u6587\u4ef6\u3002<\/p>\n<p>\u64cd\u4f5c\u7cfb\u7edf\uff1aCentOS 8.1\u548cDebian 10 Buster<\/p>\n<p>Caddy\u7248\u672c\uff1av2.1.1<\/p>\n<p><strong>\u5728Linux\u4e2d\u5b89\u88c5Caddy Web Server<\/strong><\/p>\n<p>\u4e0d\u7ba1\u60a8\u4f7f\u7528\u7684\u662f\u54ea\u79cd\u5e73\u53f0\u548c\u54ea\u79cd\u4f53\u7cfb\u7ed3\u6784\uff0ccaddy\u90fd\u53ef\u4ee5\u7acb\u5373\u4f7f\u7528\u4e8c\u8fdb\u5236\u8f6f\u4ef6\u5305\uff0c\u53ef\u4ee5\u4f7f\u7528\u6240\u793a\u7684\u9ed8\u8ba4\u8f6f\u4ef6\u5305\u7ba1\u7406\u5668\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\n<p>\u5728Fedora\uff0cRedHat\u548cCentOS\u4e2d\u5b89\u88c5Caddy<\/p>\n<p>\u6211\u4eec\u5c06\u4eceFedora\u6216RHEL\/CentOS 8\u4e0b\u7684CORP\u5b58\u50a8\u5e93\u4e2d\u5b89\u88c5\u6700\u65b0\u7248\u672c\u7684Caddy Web\u670d\u52a1\u5668\u3002<\/p>\n<p># dnf install &#8216;dnf-command(copr)&#8217;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-1536\" src=\"https:\/\/www.linuxmi.com\/wp-content\/uploads\/2020\/07\/Caddy-2.png\" alt=\"\" width=\"731\" height=\"469\" srcset=\"https:\/\/www.linuxmi.com\/wp-content\/uploads\/2020\/07\/Caddy-2.png 734w, https:\/\/www.linuxmi.com\/wp-content\/uploads\/2020\/07\/Caddy-2-300x193.png 300w, https:\/\/www.linuxmi.com\/wp-content\/uploads\/2020\/07\/Caddy-2-430x276.png 430w\" sizes=\"auto, (max-width: 731px) 100vw, 731px\" \/><\/p>\n<p># dnf copr enable @caddy\/caddy<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-1537\" src=\"https:\/\/www.linuxmi.com\/wp-content\/uploads\/2020\/07\/Caddy-3.png\" alt=\"\" width=\"731\" height=\"487\" srcset=\"https:\/\/www.linuxmi.com\/wp-content\/uploads\/2020\/07\/Caddy-3.png 734w, https:\/\/www.linuxmi.com\/wp-content\/uploads\/2020\/07\/Caddy-3-300x200.png 300w, https:\/\/www.linuxmi.com\/wp-content\/uploads\/2020\/07\/Caddy-3-430x286.png 430w\" sizes=\"auto, (max-width: 731px) 100vw, 731px\" \/><\/p>\n<p># dnf install caddy<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-1538\" src=\"https:\/\/www.linuxmi.com\/wp-content\/uploads\/2020\/07\/Caddy-4.png\" alt=\"\" width=\"731\" height=\"523\" srcset=\"https:\/\/www.linuxmi.com\/wp-content\/uploads\/2020\/07\/Caddy-4.png 734w, https:\/\/www.linuxmi.com\/wp-content\/uploads\/2020\/07\/Caddy-4-300x215.png 300w, https:\/\/www.linuxmi.com\/wp-content\/uploads\/2020\/07\/Caddy-4-430x308.png 430w\" sizes=\"auto, (max-width: 731px) 100vw, 731px\" \/><\/p>\n<p>\u5728RHEL\/CentOS 7\u4e0a\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u3002<\/p>\n<p># yum install yum-plugin-copr<br \/>\n# yum copr enable @caddy\/caddy<br \/>\n# yum install caddy<\/p>\n<p>\u5728Debian\u548cUbuntu\u4e2d\u5b89\u88c5Caddy<\/p>\n<p>$ echo &#8220;deb [trusted=yes] https:\/\/apt.fury.io\/caddy\/ \/&#8221; \\<br \/>\n| sudo tee -a \/etc\/apt\/sources.list.d\/caddy-fury.list<br \/>\n$ sudo apt update<br \/>\n$ sudo apt install caddy<\/p>\n<p>\u5b89\u88c5caddy Web\u670d\u52a1\u5668\u540e\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0bsystemctl\u547d\u4ee4\u542f\u52a8\uff0c\u542f\u7528\u548c\u68c0\u67e5\u670d\u52a1\u72b6\u6001\u3002<\/p>\n<p># systemctl start caddy<br \/>\n# systemctl enable caddy<br \/>\n# systemctl status caddy<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-1539\" src=\"https:\/\/www.linuxmi.com\/wp-content\/uploads\/2020\/07\/Caddy-5.png\" alt=\"\" width=\"731\" height=\"505\" srcset=\"https:\/\/www.linuxmi.com\/wp-content\/uploads\/2020\/07\/Caddy-5.png 734w, https:\/\/www.linuxmi.com\/wp-content\/uploads\/2020\/07\/Caddy-5-300x207.png 300w, https:\/\/www.linuxmi.com\/wp-content\/uploads\/2020\/07\/Caddy-5-430x297.png 430w\" sizes=\"auto, (max-width: 731px) 100vw, 731px\" \/><\/p>\n<p>\u73b0\u5728\u6253\u5f00\u6d4f\u89c8\u5668\uff0c\u5c06\u6d4f\u89c8\u5668\u6307\u5411\u4ee5\u4e0b\u5730\u5740\uff0c\u60a8\u5e94\u8be5\u53ef\u4ee5\u770b\u5230caddy\u6b22\u8fce\u9875\u9762\u3002<\/p>\n<p>https:\/\/www.linuxmi.com<\/p>\n<p><a href=\"https:\/\/www.linuxmi.com\/wp-content\/uploads\/2020\/07\/caddy.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1540 size-large\" src=\"https:\/\/www.linuxmi.com\/wp-content\/uploads\/2020\/07\/caddy-1024x576.png\" alt=\"\" width=\"731\" height=\"411\" srcset=\"https:\/\/www.linuxmi.com\/wp-content\/uploads\/2020\/07\/caddy-1024x576.png 1024w, https:\/\/www.linuxmi.com\/wp-content\/uploads\/2020\/07\/caddy-300x169.png 300w, https:\/\/www.linuxmi.com\/wp-content\/uploads\/2020\/07\/caddy-768x432.png 768w, https:\/\/www.linuxmi.com\/wp-content\/uploads\/2020\/07\/caddy-1536x864.png 1536w, https:\/\/www.linuxmi.com\/wp-content\/uploads\/2020\/07\/caddy-430x242.png 430w, https:\/\/www.linuxmi.com\/wp-content\/uploads\/2020\/07\/caddy.png 1920w\" sizes=\"auto, (max-width: 731px) 100vw, 731px\" \/><\/a><\/p>\n<p><strong>\u4f7f\u7528Caddy\u8bbe\u7f6e\u57df<\/strong><\/p>\n<p>\u8981\u8bbe\u7f6e\u57df\uff0c\u9996\u5148\uff0c\u60a8\u9700\u8981\u5728DNS\u63a7\u5236\u9762\u677f\u4e2d\u5c06\u57df\u7684A\/AAAA DNS\u8bb0\u5f55\u6307\u5411\u6b64\u670d\u52a1\u5668\u3002\u63a5\u4e0b\u6765\uff0c\u5982\u56fe\u6240\u793a\uff0c&#8221;linuxmi.com&#8221;\u5728\u6587\u4ef6\u5939\u4e0b\u4e3a\u60a8\u7684\u7f51\u7ad9\u521b\u5efa\u6587\u6863\u6839\u76ee\u5f55\/var\/www\/html\u3002<\/p>\n<p>$ mkdir \/var\/www\/html\/linuxmi.com<\/p>\n<p>\u5982\u679c\u4f7f\u7528\u7684\u662fSELinux\uff0c\u5219\u9700\u8981\u66f4\u6539Web\u5185\u5bb9\u7684\u6587\u4ef6\u5b89\u5168\u6027\u4e0a\u4e0b\u6587\u3002<\/p>\n<p># chcon -t httpd_sys_content_t \/var\/www\/html\/example.com -R<br \/>\n# chcon -t httpd_sys_rw_content_t \/var\/www\/html\/example.com -R<\/p>\n<p>\u73b0\u5728\uff0c\u5728\u6253\u5f00\u5e76\u7f16\u8f91Caddy\u914d\u7f6e\u6587\u4ef6\/etc\/caddy\/Caddyfile\u3002<\/p>\n<p># vim \/etc\/caddy\/Caddyfile<\/p>\n<p>\u66ff\u6362:80\u4e3a\u60a8\u7684\u57df\u540d\uff0c\u7136\u540e\u5c06\u7ad9\u70b9\u6839\u76ee\u5f55\u66f4\u6539\/var\/www\/html\/linuxmi.com\u4e3a\u6240\u793a\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1535\" src=\"https:\/\/www.linuxmi.com\/wp-content\/uploads\/2020\/07\/Caddy-1.png\" alt=\"\" width=\"734\" height=\"507\" srcset=\"https:\/\/www.linuxmi.com\/wp-content\/uploads\/2020\/07\/Caddy-1.png 734w, https:\/\/www.linuxmi.com\/wp-content\/uploads\/2020\/07\/Caddy-1-300x207.png 300w, https:\/\/www.linuxmi.com\/wp-content\/uploads\/2020\/07\/Caddy-1-430x297.png 430w\" sizes=\"auto, (max-width: 734px) 100vw, 734px\" \/><\/p>\n<p>\u91cd\u65b0\u52a0\u8f7dCaddy\u670d\u52a1\u4ee5\u4fdd\u5b58\u914d\u7f6e\u66f4\u6539\u3002<\/p>\n<p># systemctl reload caddy<\/p>\n<p>\u73b0\u5728\u521b\u5efa\u4efb\u4f55HTML\u9875\u9762\uff08\u60a8\u53ef\u4ee5\u521b\u5efa\u81ea\u5df1\u7684HTML\u9875\u9762\uff09\uff0c\u5e76\u5c06\u9875\u9762\u4fdd\u5b58\u5728\u7f51\u7ad9\u7684\u6587\u6863\u6839\u76ee\u5f55\u4e0b\u3002<\/p>\n<p>$ mkdir \/var\/www\/html\/linuxmi.com<\/p>\n<p>\u5c06\u4ee5\u4e0b\u793a\u4f8bHTML\u4ee3\u7801\u6dfb\u52a0\u5230\u60a8\u7f51\u7ad9\u7684\u7d22\u5f15\u9875\u9762\u3002<\/p>\n<p>[root@localhost \/home\/linuxmi\/www.linuxmi.com]$echo &#8216;&lt;!doctype html&gt;&lt;head&gt;&lt;title&gt;Caddy Test Page at LinuxMi.com&lt;\/title&gt;&lt;\/head&gt;&lt;body&gt;&lt;h1&gt;Hello, World!&lt;\/h1&gt;&lt;\/body&gt;&lt;\/html&gt;&#8217; | sudo tee \/var\/www\/html\/linuxmi.com\/index.html<br \/>\n&lt;!doctype html&gt;&lt;head&gt;&lt;title&gt;Caddy Test Page at LinuxMi.com&lt;\/title&gt;&lt;\/head&gt;&lt;body&gt;&lt;h1&gt;Hello, World!&lt;\/h1&gt;&lt;\/body&gt;&lt;\/html&gt;<\/p>\n<p>\u73b0\u5728\uff0c\u518d\u6b21\u8bbf\u95ee\u60a8\u7684\u7ad9\u70b9\u4ee5\u67e5\u770b\u9875\u9762\u3002<\/p>\n<p>\u5982\u679c\u6b63\u786e\u914d\u7f6e\u4e86\u6240\u6709\u5185\u5bb9\uff0c\u5219\u5c06\u901a\u8fc7HTTPS\u534f\u8bae\u4e3a\u60a8\u7684\u57df\u63d0\u4f9b\u670d\u52a1\uff0c\u8868\u660e\u60a8\u7684\u8fde\u63a5\u662f\u5b89\u5168\u7684\u3002<\/p>\n<p><strong>\u603b\u7ed3<\/strong><\/p>\n<p>\u5982\u679c\u60a8\u662f\u65b0\u624b\uff0c\u5e76\u4e14\u60f3\u8981\u5728\u4e0d\u5f71\u54cd\u914d\u7f6e\u7684\u60c5\u51b5\u4e0b\u8bbe\u7f6e\u7f51\u7edc\u670d\u52a1\u5668\uff0c\u90a3\u4e48\u6b64\u5de5\u5177\u975e\u5e38\u9002\u5408\u60a8\u3002\u5373\u4f7f\u60a8\u662f\u7ecf\u9a8c\u4e30\u5bcc\u7684\u7528\u6237\uff0c\u4e5f\u9700\u8981\u5373\u65f6\u4e14\u7b80\u5355\u7684Web\u670d\u52a1\u5668Caddy\u503c\u5f97\u4e00\u8bd5\u3002\u53ea\u9700\u8fdb\u884c\u4e00\u4e9b\u914d\u7f6e\uff0c\u5982\u679c\u60a8\u9700\u8981\u8bbe\u7f6e\u66f4\u590d\u6742\u548c\u9ad8\u7ea7\u7684Web\u670d\u52a1\u5668\uff0c\u5219\u8fd8\u53ef\u4ee5\u8bbe\u7f6e\u6587\u4ef6\u5939\u6743\u9650\uff0c\u63a7\u5236\u8eab\u4efd\u9a8c\u8bc1\uff0c\u9519\u8bef\u9875\u9762\uff0cGzip\uff0cHTTP\u91cd\u5b9a\u5411\u7b49\u3002<\/p>\n<p>\u4e0d\u8981\u5c06Caddy\u66ff\u4ee3Apache\u6216Nginx\u3002Caddy\u5e76\u975e\u8bbe\u8ba1\u7528\u4e8e\u5904\u7406\u9ad8\u6d41\u91cf\u7684\u751f\u4ea7\u73af\u5883\u3002\u5f53\u60a8\u5173\u6ce8\u901f\u5ea6\u548c\u53ef\u9760\u6027\u65f6\uff0c\u5b83\u53ef\u7528\u4e8e\u5feb\u901f\u8bbe\u7f6eWeb\u670d\u52a1\u5668\u3002<\/p>\n<p><strong>\u53c2\u8003\u8d44\u6599<\/strong><\/p>\n<p>Caddy \u5b8c\u6574\u7684\u7528\u6237\u6307\u5357\/\u5b8c\u6574\u7684\u6587\u6863\u89c1<a href=\"https:\/\/caddyserver.com\/docs\" target=\"_blank\" rel=\"noopener noreferrer\">\u8fd9\u91cc<\/a>\u3002<\/p>\n<p>\u6211\u4eec\u5206\u4eab\u6b64\u6587\u6863\u65e8\u5728\u5728\u5fc5\u8981\u65f6\u5feb\u901f\u67e5\u770b\u548c\u5b89\u88c5\u5e26\u6709\u56fe\u50cf\u7684\u8bf4\u660e\u3002\u5982\u679c\u60a8\u6709\u8be5\u9879\u76ee\u7684\u4efb\u4f55\u5efa\u8bae\uff0c\u53ef\u4ee5\u5728Linux\u8ff7\u7684\u8bc4\u8bba\u90e8\u5206\u4e2d\u7559\u8a00\u7ed9\u6211\u4eec\u3002<\/p>\n<p>\u5bf9\u6211\u6765\u8bf4\uff0c\u8fd9\u4e2a\u9879\u76ee\u8fd8\u592a\u5e74\u8f7b\uff0c\u4f46\u4ecd\u7136\u53ef\u4ee5\u5b8c\u7f8e\u5730\u5de5\u4f5c\uff0c\u800c\u4e14\u4f3c\u4e4e\u5f88\u5f3a\u5927\uff0c\u5f88\u6709\u524d\u9014\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Web\u670d\u52a1\u5668\u662f\u670d\u52a1\u5668\u7aef\u5e94\u7528\u7a0b\u5e8f\uff0c\u65e8\u5728\u5904\u7406\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u4e4b\u95f4\u7684HTTP\u8bf7\u6c42\u3002HTTP\u662f\u6700\u5e7f\u6cdb\u4f7f\u7528\u7684\u57fa\u672c &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[3],"tags":[132],"class_list":["post-1533","post","type-post","status-publish","format-standard","hentry","category-linux","tag-caddy"],"aioseo_notices":[],"views":778,"_links":{"self":[{"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/posts\/1533","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/comments?post=1533"}],"version-history":[{"count":3,"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/posts\/1533\/revisions"}],"predecessor-version":[{"id":1542,"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/posts\/1533\/revisions\/1542"}],"wp:attachment":[{"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/media?parent=1533"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/categories?post=1533"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/tags?post=1533"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}