{"id":14,"date":"2026-07-20T17:05:44","date_gmt":"2026-07-20T09:05:44","guid":{"rendered":"https:\/\/blog.1988idc.cn\/?p=14"},"modified":"2026-07-20T20:58:47","modified_gmt":"2026-07-20T12:58:47","slug":"%e5%93%aa%e5%90%92%e7%9b%91%e6%8e%a7%e7%bb%88%e7%ab%af-404-%e6%95%85%e9%9a%9c%e5%a4%8d%e7%9b%98","status":"publish","type":"post","link":"https:\/\/blog.1988idc.cn\/index.php\/2026\/07\/20\/%e5%93%aa%e5%90%92%e7%9b%91%e6%8e%a7%e7%bb%88%e7%ab%af-404-%e6%95%85%e9%9a%9c%e5%a4%8d%e7%9b%98\/","title":{"rendered":"\u54ea\u5412\u76d1\u63a7\u7ec8\u7aef 404 \u6545\u969c\u590d\u76d8"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote is-style-plain is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>\u8f6c\u8f7d\u58f0\u660e\uff1a<\/strong>\u672c\u6587\u8f6c\u8f7d\u81f3<a href=\"https:\/\/blog.hyun.cc\/\">\u7384\u5916\u4e4b\u97f3<\/a>\uff0c\u539f\u6587\u94fe\u63a5<a href=\"https:\/\/blog.hyun.cc\/post\/5BSKOr\/\">\u54ea\u5412\u76d1\u63a7\u7ec8\u7aef 404 \u6545\u969c\u590d\u76d8 | \u7384\u5916\u4e4b\u97f3<\/a>\uff0c\u4f5c\u8005\uff1a\u8eab\u4e16\uff0c\u539f\u6587\u53d1\u5e03\u65f6\u95f4\uff1a2026\/05\/18\uff0c\u539f\u6587\u5feb\u7167<a href=\"https:\/\/pic.1988idc.cn\/pic\/2026-07-20-6.jpg\">https:\/\/pic.1988idc.cn\/pic\/2026-07-20-6.jpg<\/a><\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">\u4eca\u5929\u628a\u54ea\u5412\u76d1\u63a7\u5347\u7ea7\u4e86\u4e00\u4e0b\uff0c\u5347\u7ea7\u540e\u5e38\u89c4\u56fe\u8868\u4e0e Agent gRPC \u72b6\u6001\u4e0a\u62a5\u5747\u6b63\u5e38\uff0c\u552f\u72ec\u5728\u540e\u53f0\u70b9\u51fb \u201c\u7ec8\u7aef\u7ba1\u7406\u201d\uff08\u8def\u5f84 \/dashboard\/terminal\/:id\uff09\u65f6\uff0c\u547d\u4ee4\u884c\u7a97\u53e3\u6b7b\u6d3b\u5f39\u4e0d\u51fa\u6765\u3002\u76f4\u63a5\u62a5\u9519404.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/blog.1988idc.cn\/wp-content\/uploads\/2026\/07\/726e59bebb5bcf922bdc27c833c5a541-1024x438.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"438\" data-original=\"https:\/\/blog.1988idc.cn\/wp-content\/uploads\/2026\/07\/726e59bebb5bcf922bdc27c833c5a541-1024x438.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" class=\"wp-image-15\"  sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/div><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u53bb\u7ffb Nginx \u7684\u5b9e\u65f6\u8bbf\u95ee\u65e5\u5fd7\uff0c\u6293\u5230\u4e86\u8fd9\u4e48\u4e00\u6761\u8bb0\u5f55\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\"GET \/dashboard\/terminal\/5 HTTP\/2.0\" 404 468 \"https:\/\/nz.7zz.cn\/dashboard\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u5c31\u8bf4\u660e\u8bf7\u6c42\u901a\u8fc7 HTTP\/2.0 \u8fdb\u6765\u4e86\uff0c\u4f46\u540e\u7aef\u76f4\u63a5\u56de\u4e86\u4e2a&nbsp;<code>404<\/code>\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6211\u524d\u540e\u6392\u67e5\u4e86\u51e0\u8f6e\uff0c\u4ece Nginx \u4e00\u8def\u6392\u67e5\u5230\u88ab\u63a7\u7aef\uff0c\u6700\u540e\u53d1\u73b0\u88ab\u4e00\u4e2a\u6781\u5ea6\u9690\u853d\u7684\u8fb9\u7f18\u8282\u70b9\u62e6\u622a\u95ee\u9898\u7ed9\u5751\u4e86\u3002\u8bb0\u5f55\u4e00\u4e0b\u6b7b\u78d5\u7684\u8fc7\u7a0b\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e00\u3001 Nginx \u7f13\u51b2\u533a\u7684\u914d\u7f6e\u5ba1\u67e5\u5751 (<code>[emerg]<\/code>)<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u54ea\u5412 v1 \u7684\u5728\u7ebf\u7ec8\u7aef\u5f3a\u4f9d\u8d56\u6807\u51c6\u7684 WebSocket \u957f\u8fde\u63a5\u5347\u7ea7\u3002\u4e00\u5f00\u59cb\u4e3a\u4e86\u4f18\u5316\u5927\u6d41\u91cf\u4e0b\u7684\u6027\u80fd\uff0c\u6211\u987a\u624b\u5728&nbsp;<code>location \/<\/code>&nbsp;\u91cc\u9762\u585e\u4e86\u81ea\u5b9a\u4e49\u7684\u7f13\u51b2\u533a\u53c2\u6570\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>proxy_buffer_size 128k;\nproxy_buffers 4 256k;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u7ed3\u679c\u5728\u5b9d\u5854\u9762\u677f\u4e00\u4fdd\u5b58\uff0cNginx \u8bed\u6cd5\u6d4b\u8bd5\u76f4\u63a5\u70b8\u4e86\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;emerg] \"proxy_temp_file_write_size\" must be equal to or greater than the maximum of the value...<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u539f\u56e0<\/strong>\uff1a\u5b9d\u5854\u5728\u5168\u5c40&nbsp;<code>nginx.conf<\/code>&nbsp;\u91cc\u9ed8\u8ba4\u7ed9\u7684&nbsp;<code>proxy_temp_file_write_size<\/code>&nbsp;\u592a\u5c0f\u4e86\u3002Nginx \u89c4\u8303\u89c4\u5b9a\uff0c<strong>\u4e34\u65f6\u6587\u4ef6\u5199\u5165\u5927\u5c0f\u5fc5\u987b\u5927\u4e8e\u6216\u7b49\u4e8e\u7f13\u51b2\u533a\u7684\u6700\u5927\u503c<\/strong>\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u89e3\u51b3\u529e\u6cd5<\/strong>\uff1a\u6211\u628a\u8fd9\u5806\u81ea\u5b9a\u4e49\u7f13\u51b2\u533a\u914d\u7f6e\u76f4\u63a5\u63d0\u5230&nbsp;<code>server<\/code>&nbsp;\u5757\u7684\u9876\u90e8\uff0c\u5e76\u4e14\u663e\u5f0f\u5b9a\u4e49&nbsp;<code>proxy_temp_file_write_size 256k;<\/code>\uff0c\u8ba9\u5b83\u53d8\u6210\u5168\u7ad9\u7edf\u4e00\u89c4\u683c\uff0c\u987a\u5229\u901a\u8fc7 Nginx \u6d4b\u8bd5\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e8c\u3001 \u534f\u8bae\u5bf9\u9f50\u4e0e\u9ad8\u4f18\u5148\u7ea7\u6b63\u5219\u62e6\u622a<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u54ea\u5412\u65b0\u7248\u9762\u677f\u5bf9 API \u8def\u7531\u505a\u4e86\u91cd\u6784\u3002\u666e\u901a\u7684 Web \u6d41\u91cf\u8d70\u5e38\u89c4\u8f6c\u53d1\uff0c\u4f46\u7ec8\u7aef\u8d70\u7684\u662f\u4e13\u95e8\u7684 WebSocket \u6b63\u5219\u8def\u7531\u3002\u6211\u5728 Nginx \u4e2d\u5f15\u5165\u4e86\u9ad8\u4f18\u5148\u7ea7\u7684\u6b63\u5219\u5339\u914d\u5757\uff08<code>~*<\/code>&nbsp;\u4f18\u5148\u7ea7\u9ad8\u4e8e&nbsp;<code>\/<\/code>\uff09\uff0c\u5e76\u8865\u5168\u4e86\u8de8\u57df\u9274\u6743\u5934\uff08<code>Origin<\/code>\uff09\u548c\u8fde\u63a5\u5347\u7ea7\u5934\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u54ea\u5412\u5b98\u65b9\u6807\u51c6\uff1aWebSocket \u76f8\u5173\u62e6\u622a\nlocation ~* ^\/api\/v1\/ws\/(server|terminal|file)(.*)$ {\n    proxy_set_header Host $host;\n    proxy_set_header nz-realip $http_cf_connecting_ip; \n    proxy_set_header Origin https:\/\/$host; # \u8de8\u57df\u9274\u6743\u5173\u952e\u5934\n    proxy_set_header Upgrade $http_upgrade;\n    proxy_set_header Connection \"upgrade\";\n    proxy_read_timeout 3600s;\n    proxy_send_timeout 3600s;\n    proxy_pass http:\/\/127.0.0.1:8008;\n}\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5230\u8fd9\u4e00\u6b65\uff0cNginx \u5c42\u7684\u8f6c\u53d1\u903b\u8f91\u5df2\u7ecf\u5f7b\u5e95\u901a\u4e86\u3002\u7136\u800c\u5237\u65b0\u6d4f\u89c8\u5668\u53bb\u70b9\u7ec8\u7aef\uff0c\u4f9d\u7136\u662f&nbsp;<code>404<\/code>\u3002\u6211\u5f53\u65f6\u751a\u81f3\u6000\u7591\u662f\u67d0\u4e9b\u8001\u65e7\u88ab\u63a7\u7aef\u7684\u9b54\u6539\u534f\u8bae\u6216\u8005 Docker \u955c\u50cf\u6ca1\u66f4\u65b0\u5e72\u51c0\uff0c\u7ed3\u679c\u4e00\u987f\u91cd\u88c5\u3001\u5f3a\u62c9\u5b98\u65b9\u6700\u65b0\u955c\u50cf\u4e0b\u6765\uff0c\u4f9d\u65e7\u6ca1\u6709\u4efb\u4f55\u5375\u7528\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e09\u3001 \u771f\u76f8\uff1aCloudflare \u81ea\u5b9a\u4e49 404 \u9875\u9762\u7684\u201c\u964d\u7ef4\u6253\u51fb\u201d<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u6700\u540e\u6211\u628a\u89c6\u7ebf\u79fb\u5411\u6700\u5916\u5c42\u7684 Cloudflare\uff0c\u624d\u53d1\u73b0\u95ee\u9898\u6839\u672c\u4e0d\u5728\u670d\u52a1\u5668\u5185\u90e8\uff0c\u800c\u662f&nbsp;<strong>\u6211\u4e4b\u524d\u5728 CF \u540e\u53f0\u914d\u7f6e\u7684\u201c\u81ea\u5b9a\u4e49\u9519\u8bef\u9875\u9762\uff08Custom Pages\uff09\u201d\u62e6\u622a\u4e86\u8def\u7531<\/strong>\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5e95\u5c42\u903b\u8f91\u5206\u6790\uff1a<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>1.SPA \u865a\u62df\u8def\u7531\uff1a\u65b0\u7248\u54ea\u5412\u7684\u524d\u7aef\u662f\u57fa\u4e8e\u73b0\u4ee3\u6846\u67b6\u6784\u5efa\u7684\u5355\u9875\u9762\u5e94\u7528\uff08SPA\uff09\u3002\u70b9\u7ec8\u7aef\u65f6\u6d4f\u89c8\u5668\u8bf7\u6c42\u7684 \/dashboard\/terminal\/5\uff0c\u5728\u670d\u52a1\u5668\u4e0a\u538b\u6839\u6ca1\u6709\u771f\u5b9e\u7684\u7269\u7406\u6587\u4ef6\uff0c\u5b83\u53ea\u662f\u4e2a\u524d\u7aef\u865a\u62df\u8def\u5f84\u3002\n2.\u540e\u7aef\u7684 Fallback \u673a\u5236\uff1a\u5f53\u6211\u76f4\u63a5\u8bf7\u6c42\u8fd9\u4e2a\u865a\u62df\u8def\u5f84\u65f6\uff0c\u54ea\u5412\u540e\u7aef\u7684 Go \u6846\u67b6\u56e0\u4e3a\u627e\u4e0d\u5230\u7269\u7406\u6587\u4ef6\uff0c\u786e\u5b9e\u4f1a\u5411\u5916\u629b\u51fa\u4e00\u4e2a 404 \u72b6\u6001\u7801\u3002\u4f46\u5728\u6b63\u5e38\u60c5\u51b5\u4e0b\uff0c\u5b83\u4f1a\u540c\u65f6\u9644\u5e26\u8fd4\u56de\u524d\u7aef\u7684 JS \u5f15\u5bfc\u6587\u4ef6\uff0c\u8ba9\u6d4f\u89c8\u5668\u62ff\u5230\u540e\u5728\u672c\u5730\u52a8\u6001\u89e3\u6790\u5e76\u6e32\u67d3\u51fa\u7ec8\u7aef\u7a97\u53e3\u3002\n3.CF \u7684\u70ed\u5fc3\u62e6\u622a\uff1a\u574f\u5c31\u574f\u5728\u6211\u4e4b\u524d\u5728 Cloudflare \u540e\u53f0\u5f00\u542f\u4e86 \u201c404 \u81ea\u5b9a\u4e49\u9519\u8bef\u9875\u9762 (Custom 404 Page)\u201d\u3002CF \u7684\u8fb9\u7f18\u8282\u70b9\u4e00\u65e6\u55c5\u63a2\u5230\u540e\u7aef\u5410\u51fa\u7684 404 \u72b6\u6001\u7801\uff0c\u5c31\u4f1a\u81ea\u4f5c\u806a\u660e\u5730\u5224\u5b9a\u201c\u8fd9\u662f\u4e00\u4e2a\u6b7b\u94fe\u201d\uff0c\u7136\u540e\u5f3a\u884c\u628a\u540e\u7aef\u539f\u672c\u9644\u5e26\u7684\u3001\u7528\u6765\u521d\u59cb\u5316\u524d\u7aef\u8def\u7531\u7684 JS \u6570\u636e\u5168\u90e8\u62b9\u6389\uff0c\u66ff\u6362\u6210\u4e86\u6211\u81ea\u5b9a\u4e49\u7684 HTML 404 \u9875\u9762\u3002<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u7ed3\u679c\u5c31\u662f\u524d\u7aef\u52a8\u6001\u811a\u672c\u76f4\u63a5\u65ad\u6d41\uff0c\u6d4f\u89c8\u5668\u6839\u672c\u62ff\u4e0d\u5230\u6e32\u67d3\u7ec8\u7aef\u7684\u6838\u5fc3\u4ee3\u7801\u3002\u6211\u5728 Nginx \u65e5\u5fd7\u91cc\u770b\u5230\u7684&nbsp;<code>404 468<\/code>\uff0c\u5176\u5b9e\u5c31\u662f\u8bf7\u6c42\u88ab CF \u5f3a\u884c\u62e6\u622a\u5e72\u6d89\u540e\u7684\u5047\u8c61\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u56db\u3001 \u6700\u7ec8\u89e3\u51b3<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u89e3\u51b3\u65b9\u5f0f\u975e\u5e38\u7c97\u66b4\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>1.\u767b\u5f55 Cloudflare \u63a7\u5236\u53f0\u3002\n2.\u8fdb\u5165\u5bf9\u5e94\u57df\u540d -&gt; \u81ea\u5b9a\u4e49\u9875\u9762 (Custom Pages)\u3002\n3.\u627e\u5230 404 \u9519\u8bef\u9875 (404 Error Page)\uff0c\u76f4\u63a5\u628a\u5b83\u5220\u6389\uff0c\u6062\u590d\u6210\u9ed8\u8ba4\u72b6\u6001\uff08\u4e0d\u62e6\u622a\uff09\u3002<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u518d\u53bb\u70b9\u5728\u7ebf\u7ec8\u7aef\uff0c\u719f\u6089\u7684\u9ed1\u8272\u547d\u4ee4\u884c\u77ac\u95f4\u79d2\u8fde\uff0c\u4e1d\u6ed1\u65e0\u6bd4\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u539f\u6587\u6807\u7b7e\uff1a<a href=\"https:\/\/blog.hyun.cc\/tag\/cloudflare\/\">cloudflare<\/a>,&nbsp;<a href=\"https:\/\/blog.hyun.cc\/tag\/na-zha-tan-zhen\/\">\u54ea\u5412\u63a2\u9488<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8f6c\u8f7d\u58f0\u660e\uff1a\u672c\u6587\u8f6c\u8f7d\u81f3\u7384\u5916\u4e4b\u97f3\uff0c\u539f\u6587\u94fe\u63a5\u54ea\u5412\u76d1\u63a7\u7ec8\u7aef 404 \u6545\u969c\u590d\u76d8 | \u7384\u5916\u4e4b\u97f3\uff0c\u4f5c\u8005\uff1a\u8eab\u4e16\uff0c\u539f\u6587\u53d1\u5e03\u65f6\u95f4\uff1a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3,4],"class_list":["post-14","post","type-post","status-publish","format-standard","hentry","category-26-7-20","tag-cloudflare","tag-4"],"_links":{"self":[{"href":"https:\/\/blog.1988idc.cn\/index.php\/wp-json\/wp\/v2\/posts\/14","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.1988idc.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.1988idc.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.1988idc.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.1988idc.cn\/index.php\/wp-json\/wp\/v2\/comments?post=14"}],"version-history":[{"count":2,"href":"https:\/\/blog.1988idc.cn\/index.php\/wp-json\/wp\/v2\/posts\/14\/revisions"}],"predecessor-version":[{"id":17,"href":"https:\/\/blog.1988idc.cn\/index.php\/wp-json\/wp\/v2\/posts\/14\/revisions\/17"}],"wp:attachment":[{"href":"https:\/\/blog.1988idc.cn\/index.php\/wp-json\/wp\/v2\/media?parent=14"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.1988idc.cn\/index.php\/wp-json\/wp\/v2\/categories?post=14"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.1988idc.cn\/index.php\/wp-json\/wp\/v2\/tags?post=14"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}