{"id":1998,"date":"2024-11-10T08:22:50","date_gmt":"2024-11-10T00:22:50","guid":{"rendered":"https:\/\/fwq.ai\/blog\/1998\/"},"modified":"2024-11-10T08:22:50","modified_gmt":"2024-11-10T00:22:50","slug":"gitee-page-%e9%9d%99%e6%80%81%e7%bd%91%e7%ab%99%e9%83%a8%e7%bd%b2%e5%87%ba%e7%8e%b0-404-%e9%94%99%e8%af%af%ef%bc%9a%e5%a6%82%e4%bd%95%e8%a7%a3%e5%86%b3%e5%8d%95%e4%b8%aa%e6%96%87%e4%bb%b6%e4%b8%8d","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/1998\/","title":{"rendered":"Gitee Page \u9759\u6001\u7f51\u7ad9\u90e8\u7f72\u51fa\u73b0 404 \u9519\u8bef\uff1a\u5982\u4f55\u89e3\u51b3\u5355\u4e2a\u6587\u4ef6\u4e0d\u5b58\u5728\u7684\u95ee\u9898\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173062730248687.jpg\" class=\"aligncenter\" title=\"Gitee Page \u9759\u6001\u7f51\u7ad9\u90e8\u7f72\u51fa\u73b0 404 \u9519\u8bef\uff1a\u5982\u4f55\u89e3\u51b3\u5355\u4e2a\u6587\u4ef6\u4e0d\u5b58\u5728\u7684\u95ee\u9898\uff1f\u63d2\u56fe\" alt=\"Gitee Page \u9759\u6001\u7f51\u7ad9\u90e8\u7f72\u51fa\u73b0 404 \u9519\u8bef\uff1a\u5982\u4f55\u89e3\u51b3\u5355\u4e2a\u6587\u4ef6\u4e0d\u5b58\u5728\u7684\u95ee\u9898\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u9759\u6001\u7f51\u7ad9\u7684404\u9519\u8bef\uff1a\u89e3\u51b3\u5355\u4e2a\u6587\u4ef6\u4e0d\u5b58\u5728\u7684\u95ee\u9898<\/strong><\/p>\n<p>\u5728\u642d\u5efa\u57fa\u4e8e Gitee Page \u7684\u9759\u6001\u7f51\u7ad9\u65f6\uff0c\u7531\u4e8e\u5355\u4e2a\u6587\u4ef6\u4e0d\u5b58\u5728\uff0c\u53ef\u80fd\u4f1a\u5bfc\u81f4\u90e8\u7f72\u9519\u8bef\uff0c\u51fa\u73b0 404 \u9875\u9762\u3002\u5982\u679c\u4f60\u5728\u6392\u9664\u5176\u4ed6\u95ee\u9898\u540e\u53d1\u73b0\u8fd9\u662f\u5bfc\u81f4\u9519\u8bef\u7684\u539f\u56e0\uff0c\u53ef\u4ee5\u8003\u8651\u4ee5\u4e0b\u89e3\u51b3\u65b9\u6848\uff1a<\/p>\n<p><strong>1. \u68c0\u67e5 Nginx \u914d\u7f6e<\/strong><\/p>\n<p>\u786e\u4fdd Nginx \u7684\u914d\u7f6e\u4e2d\u6ca1\u6709\u8fc7\u6ee4\u6389\u5bfc\u81f4 404 \u9519\u8bef\u7684\u6587\u4ef6\u540e\u7f00\u3002\u53ef\u4ee5\u901a\u8fc7\u68c0\u67e5 Nginx \u914d\u7f6e\u6587\u4ef6\u4e2d\u7684\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n<pre>location \/ {\n  try_files $uri $uri.html $uri.htm \/index.html;\n}<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5982\u679c\u914d\u7f6e\u4e2d\u5305\u542b\u7c7b\u4f3c\u4e8e\u4e0b\u9762\u7684\u5185\u5bb9\uff0c\u5219\u53ef\u80fd\u4f1a\u5bfc\u81f4\u6587\u4ef6\u540e\u7f00\u88ab\u8fc7\u6ee4\u6389\uff1a<\/p>\n<pre>location ~* .(txt)$ {\n  deny all;\n}<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5728 Nginx \u914d\u7f6e\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u6dfb\u52a0 $uri \u6216 $uri.txt \u6765\u89e3\u51b3\u6b64\u95ee\u9898\uff1a<\/p>\n<pre>location ~* .(txt)$ {\n  try_files $uri $uri.txt =404;\n}<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p><strong>2. \u68c0\u67e5\u6587\u4ef6\u6253\u5305<\/strong><\/p>\n<p>\u786e\u4fdd\u5728\u6253\u5305\u9759\u6001\u7f51\u7ad9\u65f6\uff0c\u5bfc\u81f4 404 \u9519\u8bef\u7684\u6587\u4ef6\u5df2\u5305\u542b\u5728\u6253\u5305\u4e2d\u3002\u53ef\u4ee5\u901a\u8fc7\u67e5\u770b\u6253\u5305\u547d\u4ee4\u6216\u5de5\u5177\u7684\u8f93\u51fa\uff0c\u6216\u624b\u52a8\u68c0\u67e5\u6253\u5305\u540e\u7684\u6587\u4ef6\uff0c\u6765\u9a8c\u8bc1\u6587\u4ef6\u662f\u5426\u5df2\u6253\u5305\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fGitee Page \u9759\u6001\u7f51\u7ad9\u90e8\u7f72\u51fa\u73b0 404 \u9519\u8bef\uff1a\u5982\u4f55\u89e3\u51b3\u5355\u4e2a\u6587\u4ef6\u4e0d\u5b58\u5728\u7684\u95ee\u9898\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9759\u6001\u7f51\u7ad9\u7684404\u9519\u8bef\uff1a\u89e3\u51b3\u5355\u4e2a\u6587\u4ef6\u4e0d\u5b58\u5728\u7684\u95ee\u9898 \u5728\u642d\u5efa\u57fa\u4e8e Gitee Page \u7684\u9759\u6001\u7f51\u7ad9\u65f6\uff0c\u7531\u4e8e\u5355\u4e2a\u6587\u4ef6\u4e0d\u5b58\u5728\uff0c\u53ef\u80fd\u4f1a\u5bfc\u81f4\u90e8\u7f72\u9519\u8bef\uff0c\u51fa\u73b0 404 \u9875\u9762\u3002\u5982\u679c\u4f60\u5728\u6392\u9664\u5176\u4ed6\u95ee\u9898\u540e\u53d1\u73b0\u8fd9\u662f\u5bfc\u81f4\u9519\u8bef\u7684\u539f\u56e0\uff0c\u53ef\u4ee5\u8003\u8651\u4ee5\u4e0b\u89e3\u51b3\u65b9\u6848\uff1a 1. \u68c0\u67e5 Nginx \u914d\u7f6e \u786e\u4fdd Nginx \u7684\u914d\u7f6e\u4e2d\u6ca1\u6709\u8fc7\u6ee4\u6389\u5bfc\u81f4 404 \u9519\u8bef\u7684\u6587\u4ef6\u540e\u7f00\u3002\u53ef\u4ee5\u901a\u8fc7\u68c0\u67e5 Nginx \u914d\u7f6e\u6587\u4ef6\u4e2d\u7684\u4ee5\u4e0b\u5185\u5bb9\uff1a location \/ { try_files $uri $uri.html $uri.htm \/index.html; } \u767b\u5f55\u540e\u590d\u5236 \u5982\u679c\u914d\u7f6e\u4e2d\u5305\u542b\u7c7b\u4f3c\u4e8e\u4e0b\u9762\u7684\u5185\u5bb9\uff0c\u5219\u53ef\u80fd\u4f1a\u5bfc\u81f4\u6587\u4ef6\u540e\u7f00\u88ab\u8fc7\u6ee4\u6389\uff1a location ~* .(txt)$ { deny all; } \u767b\u5f55\u540e\u590d\u5236 \u5728 Nginx \u914d\u7f6e\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u6dfb\u52a0 $uri \u6216 $uri.txt \u6765\u89e3\u51b3\u6b64\u95ee\u9898\uff1a location ~* .(txt)$ { try_files $uri $uri.txt =404; } \u767b\u5f55\u540e\u590d\u5236 2. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-1998","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/1998","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=1998"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/1998\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=1998"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=1998"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=1998"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}