{"id":27329,"date":"2025-04-19T19:21:28","date_gmt":"2025-04-19T11:21:28","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/27329.html"},"modified":"2025-04-19T19:21:28","modified_gmt":"2025-04-19T11:21:28","slug":"%e8%b6%85%e8%b6%8a-nginx%ef%bc%81%e5%8f%b7%e7%a7%b0%e4%b8%8b%e4%b8%80%e4%bb%a3-web-%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%8c%e7%94%a8%e8%b5%b7%e6%9d%a5%e5%a4%9f%e4%bc%98%e9%9b%85%ef%bc%81","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/27329.html","title":{"rendered":"\u8d85\u8d8a Nginx\uff01\u53f7\u79f0\u4e0b\u4e00\u4ee3 Web \u670d\u52a1\u5668\uff0c\u7528\u8d77\u6765\u591f\u4f18\u96c5\uff01"},"content":{"rendered":"<p>\u4f5c\u4e3a\u540e\u7aef\u5f00\u53d1&#xff0c;\u6211\u4eec\u7ecf\u5e38\u4f1a\u4f7f\u7528\u5230Nginx&#xff0c;\u4f46\u662fNginx\u7684\u914d\u7f6e\u6709\u65f6\u5019\u5199\u8d77\u6765\u786e\u5b9e\u633a\u7e41\u7410\u3002\u4eca\u5929\u7ed9\u5927\u5bb6\u5206\u4eab\u4e00\u6b3e\u5168\u65b0\u7684Web\u670d\u52a1\u5668Caddy&#xff0c;\u5b83\u5728Github\u4e0a\u7684Star\u6570\u91cf\u5168\u9762\u8d85\u8d8aNginx&#xff0c;\u914d\u7f6e\u65b9\u5f0f\u4e5f\u66f4\u4f18\u96c5&#xff01;<\/p>\n<h3>Caddy\u7b80\u4ecb<\/h3>\n<p>Caddy\u662f\u4e00\u6b3e\u529f\u80fd\u5f3a\u5927&#xff0c;\u6269\u5c55\u6027\u9ad8\u7684Web\u670d\u52a1\u5668&#xff0c;\u76ee\u524d\u5728Github\u4e0a\u5df2\u670958K&#043;Star\u3002Caddy\u91c7\u7528Go\u8bed\u8a00\u7f16\u5199&#xff0c;\u53ef\u7528\u4e8e\u9759\u6001\u8d44\u6e90\u6258\u7ba1\u548c\u53cd\u5411\u4ee3\u7406\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419112123-680387335cc27.png\" alt=\"\" \/><\/p>\n<p>Caddy\u5177\u6709\u5982\u4e0b\u7279\u6027&#xff1a;<\/p>\n<ul>\n<li>Caddyfile\u7b80\u5355\u914d\u7f6e&#xff1a;\u63d0\u4f9b\u7b80\u5355\u3001\u6613\u4e8e\u7406\u89e3\u7684\u914d\u7f6e\u6587\u4ef6\u683c\u5f0f\u3002<\/li>\n<li>\u52a8\u6001JSON API&#xff1a;\u53ef\u5b9e\u65f6\u66f4\u65b0\u914d\u7f6e&#xff0c;\u65e0\u9700\u91cd\u542f\u670d\u52a1\u5668\u3002<\/li>\n<li>\u9ed8\u8ba4\u542f\u7528HTTPS&#xff1a;\u4e3a\u6bcf\u4e2a\u6258\u7ba1\u7ad9\u70b9\u81ea\u52a8\u542f\u7528HTTPS&#xff0c;\u65e0\u9700\u989d\u5916\u64cd\u4f5c\u3002<\/li>\n<li>\u9ad8\u6269\u5c55\u6027&#xff1a;\u80fd\u591f\u652f\u6301\u6570\u5341\u4e07\u7ad9\u70b9&#xff0c;\u975e\u5e38\u9002\u5408\u5927\u89c4\u6a21\u90e8\u7f72\u3002<\/li>\n<li>\u73b0\u4ee3\u534f\u8bae\u652f\u6301&#xff1a;\u539f\u751f\u652f\u6301HTTP\/1.1\u3001HTTP\/2 \u548cHTTP\/3\u3002<\/li>\n<li>\u8de8\u5e73\u53f0\u8fd0\u884c&#xff1a;\u65e0\u5916\u90e8\u4f9d\u8d56&#xff0c;\u5728\u4efb\u4f55\u5e73\u53f0\u4e0a\u90fd\u80fd\u7a33\u5b9a\u8fd0\u884c\u3002<\/li>\n<li>\u57fa\u4e8eGo\u8bed\u8a00&#xff1a;\u80fd\u63d0\u4f9b\u66f4\u9ad8\u7684\u5185\u5b58\u5b89\u5168\u6027\u548c\u53ef\u9760\u6027\u3002<\/li>\n<\/ul>\n<h3>\u5b89\u88c5<\/h3>\n<p>\u4f7f\u7528Docker\u6765\u5b89\u88c5Caddy\u662f\u975e\u5e38\u65b9\u4fbf\u7684&#xff0c;\u8fd9\u91cc\u6211\u4eec\u5c31\u4f7f\u7528Docker\u6765\u5b89\u88c5\u3002<\/p>\n<ul>\n<li>\u9996\u5148\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\u4e0b\u8f7dCaddy\u7684\u955c\u50cf&#xff1b;<\/li>\n<\/ul>\n<p><span class=\"token function\">docker<\/span> pull caddy<\/p>\n<ul>\n<li>\u7136\u540e\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\u8fd0\u884cCaddy\u5bb9\u5668\u3002<\/li>\n<\/ul>\n<p><span class=\"token function\">docker<\/span> run <span class=\"token parameter variable\">-p<\/span> <span class=\"token number\">80<\/span>:80 <span class=\"token parameter variable\">-p<\/span> <span class=\"token number\">443<\/span>:443 <span class=\"token parameter variable\">&#8211;name<\/span> caddy <span class=\"token punctuation\">\\\\<\/span><br \/>\n    <span class=\"token parameter variable\">-v<\/span> \/mydata\/caddy\/Caddyfile:\/etc\/caddy\/Caddyfile <span class=\"token punctuation\">\\\\<\/span><br \/>\n    <span class=\"token parameter variable\">-v<\/span> \/mydata\/caddy\/data:\/data <span class=\"token punctuation\">\\\\<\/span><br \/>\n    <span class=\"token parameter variable\">-v<\/span> \/mydata\/caddy\/site:\/srv <span class=\"token punctuation\">\\\\<\/span><br \/>\n    <span class=\"token parameter variable\">-d<\/span> caddy<\/p>\n<h3>mall\u9879\u76ee\u7b80\u4ecb<\/h3>\n<p>\u7531\u4e8e\u6211\u4eec\u4e4b\u540e\u8981\u4ee5mall\u9879\u76ee\u7684\u90e8\u7f72\u4e3a\u4f8b\u8bb2\u89e3Caddy\u7684\u4f7f\u7528&#xff0c;\u8fd9\u91cc\u7b80\u5355\u4ecb\u7ecd\u4e0bmall\u9879\u76ee\u3002mall\u9879\u76ee\u662f\u4e00\u5957\u57fa\u4e8e SpringBoot3&#043; Vue \u7684\u7535\u5546\u7cfb\u7edf&#xff08;Github\u6807\u661f60K&#xff09;&#xff0c;\u540e\u7aef\u652f\u6301\u591a\u6a21\u5757\u548c2024\u6700\u65b0\u5fae\u670d\u52a1\u67b6\u6784&#xff0c;\u91c7\u7528Docker\u548cK8S\u90e8\u7f72\u3002\u5305\u62ec\u524d\u53f0\u5546\u57ce\u9879\u76ee\u548c\u540e\u53f0\u7ba1\u7406\u7cfb\u7edf&#xff0c;\u80fd\u652f\u6301\u5b8c\u6574\u7684\u8ba2\u5355\u6d41\u7a0b&#xff01;\u6db5\u76d6\u5546\u54c1\u3001\u8ba2\u5355\u3001\u8d2d\u7269\u8f66\u3001\u6743\u9650\u3001\u4f18\u60e0\u5238\u3001\u4f1a\u5458\u3001\u652f\u4ed8\u7b49\u529f\u80fd&#xff01;<\/p>\n<ul>\n<li>Boot\u9879\u76ee&#xff1a;https:\/\/github.com\/macrozheng\/mall<\/li>\n<li>Cloud\u9879\u76ee&#xff1a;https:\/\/github.com\/macrozheng\/mall-swarm<\/li>\n<li>\u6559\u7a0b\u7f51\u7ad9&#xff1a;https:\/\/www.macrozheng.com<\/li>\n<\/ul>\n<p>\u9879\u76ee\u6f14\u793a&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419112123-68038733cad71.gif\" alt=\"\" \/><\/p>\n<h3>\u4f7f\u7528<\/h3>\n<p>\u63a5\u4e0b\u6765\u5c31\u4ee5\u6211\u7684mall\u7535\u5546\u5b9e\u6218\u9879\u76ee\u7684\u90e8\u7f72\u4e3a\u4f8b&#xff0c;\u6765\u8bb2\u89e3\u4e0bCaddy\u7684\u4f7f\u7528\u3002<\/p>\n<h4>\u9759\u6001\u4ee3\u7406<\/h4>\n<p>\u9759\u6001\u4ee3\u7406\u5c31\u662f\u5c06\u8bf7\u6c42\u4ee3\u7406\u5230\u9759\u6001\u8d44\u6e90\u4e0a\u53bb&#xff0c;\u8fd9\u91cc\u6211\u4eec\u5c06\u5bf9mall.macrozheng.com\u7684\u8bf7\u6c42\u4ee3\u7406\u5230mall\u7535\u5546\u5b9e\u6218\u9879\u76ee\u7684\u524d\u7aef\u9879\u76ee\u4e2d\u53bb\u3002<\/p>\n<ul>\n<li>\u9996\u5148\u6211\u4eec\u4fee\u6539\u4e0b\u672c\u673a\u7684host\u6587\u4ef6&#xff1a;<\/li>\n<\/ul>\n<p>192.168.3.101 mall.macrozheng.com<\/p>\n<ul>\n<li>\u7136\u540e\u5c06mall\u9879\u76ee\u540e\u53f0\u7ba1\u7406\u7cfb\u7edf\u7684\u524d\u7aef\u9879\u76ee\u4e0a\u4f20\u5230\/mydata\/caddy\/site\u76ee\u5f55\u4e0b&#xff1b;<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419112124-6803873437f72.png\" alt=\"\" \/><\/p>\n<ul>\n<li>\u7136\u540e\u4fee\u6539Caddyfile\u4e2d\u7684\u914d\u7f6e&#xff0c;\u518d\u4f7f\u7528docker restart caddy\u547d\u4ee4\u91cd\u542f\u4e0bCaddy\u5bb9\u5668&#xff1b;<\/li>\n<\/ul>\n<p>http:\/\/mall.macrozheng.com {<br \/>\n        root * \/srv\/mall<br \/>\n        file_server browse<br \/>\n}<\/p>\n<ul>\n<li>\u6b64\u65f6\u6211\u4eec\u901a\u8fc7\u8be5\u5730\u5740\u5c31\u53ef\u4ee5\u8bbf\u95ee\u5230mall\u9879\u76ee\u7684\u540e\u53f0\u7ba1\u7406\u7cfb\u7edf\u4e86&#xff1a;http:\/\/mall.macrozheng.com<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419112124-6803873461830.png\" alt=\"\" \/><\/p>\n<h4>\u52a8\u6001\u4ee3\u7406<\/h4>\n<p>\u52a8\u6001\u4ee3\u7406\u5c31\u662f\u628a\u4ee3\u7406\u670d\u52a1\u5668\u7684\u8bf7\u6c42\u8f6c\u53d1\u5230\u53e6\u4e00\u4e2a\u670d\u52a1\u4e0a\u53bb&#xff0c;\u8fd9\u91cc\u6211\u4eec\u5c06\u628a\u5bf9api.macrozheng.com\u7684\u8bf7\u6c42\u4ee3\u7406\u5230\u6f14\u793a\u73af\u5883\u7684API\u670d\u52a1\u4e0a\u53bb\u3002<\/p>\n<ul>\n<li>\u9996\u5148\u6211\u4eec\u4fee\u6539\u4e0b\u672c\u673a\u7684host\u6587\u4ef6&#xff1a;<\/li>\n<\/ul>\n<p>192.168.3.101 api.macrozheng.com<\/p>\n<ul>\n<li>\u7136\u540e\u4fee\u6539Caddyfile\u4e2d\u7684\u914d\u7f6e&#xff0c;\u518d\u4f7f\u7528docker restart caddy\u547d\u4ee4\u91cd\u542f\u4e0bCaddy\u5bb9\u5668&#xff1b;<\/li>\n<\/ul>\n<p>http:\/\/api.macrozheng.com {<br \/>\n        reverse_proxy http:\/\/admin-api.macrozheng.com<br \/>\n}<\/p>\n<ul>\n<li>\u6b64\u65f6\u6211\u4eec\u901a\u8fc7\u8be5\u5730\u5740\u5c31\u53ef\u4ee5\u8bbf\u95ee\u5230mall-admin\u670d\u52a1\u7684API\u6587\u6863\u4e86&#xff1a;http:\/\/api.macrozheng.com\/swagger-ui\/<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419112124-68038734caeb7.png\" alt=\"\" \/><\/p>\n<h4>\u6309\u76ee\u5f55\u5212\u5206<\/h4>\n<p>\u6709\u65f6\u5019\u6211\u4eec\u9700\u8981\u901a\u8fc7\u540c\u4e00\u4e2a\u57df\u540d\u7684\u4e0d\u540c\u5b50\u76ee\u5f55\u6765\u8bbf\u95ee\u4e0d\u540c\u7684\u524d\u7aef\u9879\u76ee&#xff0c;\u6bd4\u5982\u901a\u8fc7\/admin\u76ee\u5f55\u8bbf\u95eemall\u540e\u53f0\u7ba1\u7406\u7cfb\u7edf&#xff0c;\u901a\u8fc7\/app\u76ee\u5f55\u8bbf\u95eemall\u524d\u53f0\u5546\u57ce\u7cfb\u7edf\u3002<\/p>\n<ul>\n<li>\u6b64\u65f6\u53ef\u4ee5\u5bf9\u76ee\u5f55\u8fdb\u884c\u5982\u4e0b\u5212\u5206&#xff1b;<\/li>\n<\/ul>\n<p>mall.macrozheng.com\/admin #\u8bbf\u95eemall\u540e\u53f0\u7ba1\u7406\u7cfb\u7edf<br \/>\nmall.macrozheng.com\/app #\u8bbf\u95eemall\u524d\u53f0\u5546\u57ce\u7cfb\u7edf<\/p>\n<ul>\n<li>\u8fd9\u91cc\u5148\u628a\u524d\u53f0\u5546\u57ce\u7cfb\u7edf\u7684\u524d\u7aef\u9879\u76ee\u4e0a\u4f20\u5230\/mydata\/caddy\/site\u76ee\u5f55\u4e0b&#xff1b;<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419112125-680387353e065.png\" alt=\"\" \/><\/p>\n<ul>\n<li>\u4fee\u6539Caddyfile\u4e2d\u7684\u914d\u7f6e&#xff0c;\u7136\u540e\u91cd\u542f\u4e0bCaddy\u5bb9\u5668&#xff1b;<\/li>\n<\/ul>\n<p>http:\/\/mall.macrozheng.com {<br \/>\n        route \/admin\/* {<br \/>\n                uri strip_prefix \/admin<br \/>\n                file_server {<br \/>\n                        root \/srv\/admin<br \/>\n                }<br \/>\n        }<br \/>\n        route \/app\/* {<br \/>\n                uri strip_prefix \/app<br \/>\n                file_server {<br \/>\n                        root \/srv\/app<br \/>\n                }<br \/>\n        }<br \/>\n}<\/p>\n<ul>\n<li>\u6b64\u65f6\u6211\u4eec\u901a\u8fc7\u8be5\u5730\u5740\u5c31\u53ef\u4ee5\u8bbf\u95ee\u5230mall\u9879\u76ee\u7684\u540e\u53f0\u7ba1\u7406\u7cfb\u7edf\u4e86&#xff1a;http:\/\/mall.macrozheng.com\/admin\/<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419112125-680387356ad0c.png\" alt=\"\" \/><\/p>\n<ul>\n<li>\u6b64\u65f6\u6211\u4eec\u901a\u8fc7\u8be5\u5730\u5740\u5c31\u53ef\u4ee5\u8bbf\u95ee\u5230mall\u9879\u76ee\u7684\u524d\u53f0\u5546\u57ce\u7cfb\u7edf\u4e86&#xff1a;http:\/\/mall.macrozheng.com\/app\/<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419112125-68038735d9623.png\" alt=\"\" \/><\/p>\n<h4>\u6587\u4ef6\u538b\u7f29<\/h4>\n<p>\u5982\u679c\u6211\u4eec\u7684\u670d\u52a1\u5668\u5e26\u5bbd\u6bd4\u8f83\u4f4e&#xff0c;\u7f51\u7ad9\u8bbf\u95ee\u901f\u5ea6\u4f1a\u5f88\u6162&#xff0c;\u8fd9\u65f6\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u8ba9Caddy\u5f00\u542fGzip\u538b\u7f29\u6765\u63d0\u9ad8\u7f51\u7ad9\u7684\u8bbf\u95ee\u901f\u5ea6\u3002\u8fd9\u91cc\u6211\u4eec\u4ee5mall\u7684\u524d\u7aef\u9879\u76ee\u4e3a\u4f8b\u6765\u6f14\u793a\u4e0b\u5b83\u7684\u63d0\u901f\u6548\u679c\u3002<\/p>\n<ul>\n<li>\u9996\u5148\u4fee\u6539Caddyfile\u4e2d\u7684\u914d\u7f6e&#xff0c;\u4f7f\u7528encode\u6307\u4ee4\u5f00\u542fGzip\u538b\u7f29&#xff0c;\u4fee\u6539\u5b8c\u6210\u540e\u91cd\u542fCaddy\u5bb9\u5668&#xff1b;<\/li>\n<\/ul>\n<p>http:\/\/mall.macrozheng.com {<br \/>\n        root * \/srv\/mall<br \/>\n        encode {<br \/>\n            gzip<br \/>\n        }<br \/>\n        file_server browse<br \/>\n}<\/p>\n<ul>\n<li>\u6709\u4e2a\u6bd4\u8f83\u5927\u7684JS\u6587\u4ef6\u672a\u5f00\u542f\u538b\u7f29\u524d\u662f1.7M&#xff0c;\u5f00\u542f\u538b\u7f29\u540e\u662f500K\u5de6\u53f3\u3002<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419112126-680387365f4a4.png\" alt=\"\" \/><\/p>\n<h4>\u5730\u5740\u91cd\u5199<\/h4>\n<p>\u6709\u7684\u65f6\u5019\u6211\u4eec\u7684\u7f51\u7ad9\u66f4\u6362\u4e86\u57df\u540d&#xff0c;\u4f46\u8fd8\u6709\u7528\u6237\u5728\u4f7f\u7528\u8001\u7684\u57df\u540d\u8bbf\u95ee&#xff0c;\u8fd9\u65f6\u53ef\u4ee5\u901a\u8fc7Caddy\u7684\u5730\u5740\u91cd\u5199\u529f\u80fd\u6765\u8ba9\u7528\u6237\u8df3\u8f6c\u5230\u65b0\u7684\u57df\u540d\u8fdb\u884c\u8bbf\u95ee\u3002<\/p>\n<ul>\n<li>\u6211\u4eec\u9700\u8981\u4fee\u6539Caddyfile\u4e2d\u7684\u914d\u7f6e&#xff0c;\u4f7f\u7528redir\u6307\u4ee4\u91cd\u5199\u5730\u5740&#xff0c;\u4fee\u6539\u5b8c\u6210\u540e\u91cd\u542fCaddy\u5bb9\u5668&#xff1b;<\/li>\n<\/ul>\n<p>http:\/\/mall.macrozheng.com {<br \/>\n        redir https:\/\/www.macrozheng.com<br \/>\n}<\/p>\n<ul>\n<li>\u6b64\u65f6\u8bbf\u95ee\u65e7\u57df\u540dmall.macrozheng.com\u4f1a\u76f4\u63a5\u8df3\u8f6c\u5230www.macrozheng.com\u53bb\u3002<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419112126-68038736b0b34.png\" alt=\"\" \/><\/p>\n<h3>Caddyfile\u8bed\u6cd5\u89c4\u5219<\/h3>\n<p>\u5982\u679c\u5927\u5bb6\u60f3\u8981\u6df1\u5165\u5b66\u4e60Caddyfile\u7684\u8bed\u6cd5\u7684\u8bdd&#xff0c;\u8fd9\u91cc\u6709\u5bf9\u5e94\u7684\u89c4\u5219\u56fe\u548c\u89e3\u91ca&#xff0c;\u5927\u5bb6\u53ef\u4ee5\u53c2\u8003\u4e0b\u3002<\/p>\n<p>Caddyfile\u7684\u5177\u4f53\u8bed\u6cd5\u89c4\u5219\u5982\u56fe&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419112127-6803873730970.png\" alt=\"\" \/><\/p>\n<p>\u4e0b\u8868\u662f\u5bf9\u5e94\u7684\u5173\u952e\u5b57\u548c\u89e3\u91ca&#xff0c;\u5bf9\u7167\u4e0a\u56fe\u5b66\u4e60\u53ef\u4ee5\u52a0\u6df1\u7406\u89e3\u3002<\/p>\n<table>\n<tr>\u5173\u952e\u5b57\u89e3\u91ca\u4f7f\u7528<\/tr>\n<tbody>\n<tr>\n<td>Global options block<\/td>\n<td>\u670d\u52a1\u5668\u5168\u5c40\u914d\u7f6e<\/td>\n<td>\u53ef\u7528\u4e8e\u914d\u7f6e\u662f\u5426\u542f\u7528HTTPS\u548cAdmin API\u7b49<\/td>\n<\/tr>\n<tr>\n<td>Snippet<\/td>\n<td>\u53ef\u4ee5\u590d\u7528\u7684\u914d\u7f6e\u7247\u6bb5<\/td>\n<td>\u5b9a\u4e49\u597d\u540e\u8ba4\u53ef\u4ee5\u901a\u8fc7import\u5173\u952e\u5b57\u5f15\u7528<\/td>\n<\/tr>\n<tr>\n<td>Site Block<\/td>\n<td>\u5355\u4e2a\u7f51\u7ad9\u914d\u7f6e<\/td>\n<td>\u901a\u8fc7file_server\u53ef\u4ee5\u914d\u7f6e\u9759\u6001\u4ee3\u7406&#xff0c;\u901a\u8fc7reverse_proxy\u53ef\u4ee5\u914d\u7f6e\u52a8\u6001\u4ee3\u7406<\/td>\n<\/tr>\n<tr>\n<td>Matcher definition<\/td>\n<td>\u5339\u914d\u5b9a\u4e49<\/td>\n<td>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u6307\u4ee4\u4f1a\u4ea7\u751f\u5168\u5c40\u5f71\u54cd&#xff0c;\u901a\u8fc7\u5b83\u53ef\u4ee5\u6307\u5b9a\u5f71\u54cd\u8303\u56f4<\/td>\n<\/tr>\n<tr>\n<td>Comment<\/td>\n<td>\u6ce8\u91ca<\/td>\n<td>\u4f7f\u7528#\u7b26\u53f7\u5f00\u5934<\/td>\n<\/tr>\n<tr>\n<td>Site address<\/td>\n<td>\u7f51\u7ad9\u5730\u5740<\/td>\n<td>\u9ed8\u8ba4\u4f7f\u7528HTTPS&#xff0c;\u5982\u9700\u5f00\u542fHTTP&#xff0c;\u9700\u8981\u6307\u5b9ahttp:\/\/\u5f00\u5934<\/td>\n<\/tr>\n<tr>\n<td>Directive<\/td>\n<td>\u6307\u4ee4<\/td>\n<td>\u6307\u4ee4\u8d4b\u4e88\u4e86Caddy\u5f3a\u5927\u7684\u529f\u80fd<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>\u603b\u7ed3<\/h3>\n<p>\u4eca\u5929\u7ed9\u5927\u5bb6\u5206\u4eab\u4e86\u4e00\u6ce2Caddy\u7684\u4f7f\u7528&#xff0c;\u5176\u5f3a\u5927\u7684\u6307\u4ee4\u529f\u80fd&#xff0c;\u8ba9\u6211\u4eec\u65e0\u9700\u591a\u4f59\u7684\u914d\u7f6e\u5373\u53ef\u5b9e\u73b0\u5404\u79cd\u529f\u80fd&#xff0c;\u4f7f\u7528\u8d77\u6765\u786e\u5b9e\u975e\u5e38\u4f18\u96c5&#xff01;<\/p>\n<h3>\u9879\u76ee\u5730\u5740<\/h3>\n<p>https:\/\/github.com\/caddyserver\/caddy<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e30\u6b21\uff0c\u6536\u85cf9\u6b21\u3002\u4f5c\u4e3a\u540e\u7aef\u5f00\u53d1\uff0c\u6211\u4eec\u7ecf\u5e38\u4f1a\u4f7f\u7528\u5230Nginx\uff0c\u4f46\u662fNginx\u7684\u914d\u7f6e\u6709\u65f6\u5019\u5199\u8d77\u6765\u786e\u5b9e\u633a\u7e41\u7410\u3002\u4eca\u5929\u7ed9\u5927\u5bb6\u5206\u4eab\u4e00\u6b3e\u5168\u65b0\u7684Web\u670d\u52a1\u5668Caddy\uff0c\u5b83\u5728Github\u4e0a\u7684Star\u6570\u91cf\u5168\u9762\u8d85\u8d8aNginx\uff0c\u914d\u7f6e\u65b9\u5f0f\u4e5f\u66f4\u4f18\u96c5\uff01_nginx caddy<\/p>\n","protected":false},"author":2,"featured_media":27318,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[99,117,98,292,43],"topic":[],"class_list":["post-27329","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-java","tag-nginx","tag-spring-boot","tag-292","tag-43"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u8d85\u8d8a Nginx\uff01\u53f7\u79f0\u4e0b\u4e00\u4ee3 Web \u670d\u52a1\u5668\uff0c\u7528\u8d77\u6765\u591f\u4f18\u96c5\uff01 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/27329.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u8d85\u8d8a Nginx\uff01\u53f7\u79f0\u4e0b\u4e00\u4ee3 Web \u670d\u52a1\u5668\uff0c\u7528\u8d77\u6765\u591f\u4f18\u96c5\uff01 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e30\u6b21\uff0c\u6536\u85cf9\u6b21\u3002\u4f5c\u4e3a\u540e\u7aef\u5f00\u53d1\uff0c\u6211\u4eec\u7ecf\u5e38\u4f1a\u4f7f\u7528\u5230Nginx\uff0c\u4f46\u662fNginx\u7684\u914d\u7f6e\u6709\u65f6\u5019\u5199\u8d77\u6765\u786e\u5b9e\u633a\u7e41\u7410\u3002\u4eca\u5929\u7ed9\u5927\u5bb6\u5206\u4eab\u4e00\u6b3e\u5168\u65b0\u7684Web\u670d\u52a1\u5668Caddy\uff0c\u5b83\u5728Github\u4e0a\u7684Star\u6570\u91cf\u5168\u9762\u8d85\u8d8aNginx\uff0c\u914d\u7f6e\u65b9\u5f0f\u4e5f\u66f4\u4f18\u96c5\uff01_nginx caddy\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/27329.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-19T11:21:28+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419112123-680387335cc27.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/27329.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/27329.html\",\"name\":\"\u8d85\u8d8a Nginx\uff01\u53f7\u79f0\u4e0b\u4e00\u4ee3 Web \u670d\u52a1\u5668\uff0c\u7528\u8d77\u6765\u591f\u4f18\u96c5\uff01 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-19T11:21:28+00:00\",\"dateModified\":\"2025-04-19T11:21:28+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/27329.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/27329.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/27329.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u8d85\u8d8a Nginx\uff01\u53f7\u79f0\u4e0b\u4e00\u4ee3 Web \u670d\u52a1\u5668\uff0c\u7528\u8d77\u6765\u591f\u4f18\u96c5\uff01\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u8d85\u8d8a Nginx\uff01\u53f7\u79f0\u4e0b\u4e00\u4ee3 Web \u670d\u52a1\u5668\uff0c\u7528\u8d77\u6765\u591f\u4f18\u96c5\uff01 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/27329.html","og_locale":"zh_CN","og_type":"article","og_title":"\u8d85\u8d8a Nginx\uff01\u53f7\u79f0\u4e0b\u4e00\u4ee3 Web \u670d\u52a1\u5668\uff0c\u7528\u8d77\u6765\u591f\u4f18\u96c5\uff01 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e30\u6b21\uff0c\u6536\u85cf9\u6b21\u3002\u4f5c\u4e3a\u540e\u7aef\u5f00\u53d1\uff0c\u6211\u4eec\u7ecf\u5e38\u4f1a\u4f7f\u7528\u5230Nginx\uff0c\u4f46\u662fNginx\u7684\u914d\u7f6e\u6709\u65f6\u5019\u5199\u8d77\u6765\u786e\u5b9e\u633a\u7e41\u7410\u3002\u4eca\u5929\u7ed9\u5927\u5bb6\u5206\u4eab\u4e00\u6b3e\u5168\u65b0\u7684Web\u670d\u52a1\u5668Caddy\uff0c\u5b83\u5728Github\u4e0a\u7684Star\u6570\u91cf\u5168\u9762\u8d85\u8d8aNginx\uff0c\u914d\u7f6e\u65b9\u5f0f\u4e5f\u66f4\u4f18\u96c5\uff01_nginx caddy","og_url":"https:\/\/www.wsisp.com\/helps\/27329.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-19T11:21:28+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419112123-680387335cc27.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/27329.html","url":"https:\/\/www.wsisp.com\/helps\/27329.html","name":"\u8d85\u8d8a Nginx\uff01\u53f7\u79f0\u4e0b\u4e00\u4ee3 Web \u670d\u52a1\u5668\uff0c\u7528\u8d77\u6765\u591f\u4f18\u96c5\uff01 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-19T11:21:28+00:00","dateModified":"2025-04-19T11:21:28+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/27329.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/27329.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/27329.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u8d85\u8d8a Nginx\uff01\u53f7\u79f0\u4e0b\u4e00\u4ee3 Web \u670d\u52a1\u5668\uff0c\u7528\u8d77\u6765\u591f\u4f18\u96c5\uff01"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/27329","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=27329"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/27329\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/27318"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=27329"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=27329"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=27329"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=27329"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}