{"id":18753,"date":"2025-07-30T16:27:26","date_gmt":"2025-07-30T08:27:26","guid":{"rendered":"https:\/\/blog.ywdevops.cn\/?p=18753"},"modified":"2025-07-31T16:19:03","modified_gmt":"2025-07-31T08:19:03","slug":"18753","status":"publish","type":"post","link":"https:\/\/blog.ywdevops.cn\/index.php\/2025\/07\/30\/18753\/","title":{"rendered":"NGINX\u4e2dtry_files\u7528\u6cd5"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u5728 Nginx \u4e2d\uff0c<code>try_files<\/code>&nbsp;\u662f\u4e00\u4e2a\u6781\u4e3a\u5b9e\u7528\u7684\u6307\u4ee4\uff0c\u4e3b\u8981\u7528\u4e8e \u200b<strong>\u200b\u6309\u987a\u5e8f\u68c0\u67e5\u6587\u4ef6\u6216\u8def\u5f84\u662f\u5426\u5b58\u5728\u200b<\/strong>\u200b\uff0c\u5e76\u8fd4\u56de\u7b2c\u4e00\u4e2a\u5339\u914d\u5230\u7684\u8d44\u6e90\u6216\u6267\u884c\u5907\u7528\u64cd\u4f5c\u3002\u5b83\u5e38\u89c1\u4e8e&nbsp;<code>server<\/code>&nbsp;\u6216&nbsp;<code>location<\/code>&nbsp;\u5757\u4e2d\uff0c\u5c24\u5176\u5728\u5355\u9875\u5e94\u7528\uff08SPA\uff09\u3001\u9759\u6001\u8d44\u6e90\u670d\u52a1\u548c URL \u91cd\u5199\u7b49\u573a\u666f\u4e0b\u53d1\u6325\u5173\u952e\u4f5c\u7528\uff0c\u8bed\u6cd5\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>location \/ {\n    try_files file1 file2 ... fallback;\n}<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>file1<\/code>,&nbsp;<code>file2<\/code>\uff1a\u6309\u987a\u5e8f\u68c0\u67e5\u7684\u6587\u4ef6\u6216\u8def\u5f84\uff08\u76f8\u5bf9\u4e8e&nbsp;<code>root<\/code>&nbsp;\u6216&nbsp;<code>alias<\/code>&nbsp;\u6307\u5b9a\u7684\u76ee\u5f55\uff09<\/li>\n\n\n\n<li><code>fallback<\/code>\uff1a\u5f53\u6240\u6709\u6587\u4ef6\u90fd\u4e0d\u5b58\u5728\u65f6\u7684\u5907\u7528\u5904\u7406\u65b9\u5f0f\uff08\u53ef\u4ee5\u662f\u5185\u90e8\u91cd\u5b9a\u5411\uff0c\u6bd4\u5982\uff1a\/index.html\u3001\u547d\u540d location\uff0c\u6bd4\u5982\uff1a @backend \u6216\u72b6\u6001\u7801\uff0c\u6bd4\u5982\uff1a 404\/403\u7b49\uff09<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">1\u3001<strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">\u68c0\u67e5\u9759\u6001\u8d44\u6e90\u662f\u5426\u5b58\u5728<\/mark><\/strong>\uff0c\u4e0d\u5b58\u5728\u8fd4\u56deabc\u76ee\u5f55\u4e0b\u9ed8\u8ba4\u6587\u4ef6index.html\uff0c\u67e5\u770bnginx\u914d\u7f6e\u6587\u4ef6\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"654\" height=\"226\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/2-17.png\" alt=\"\" class=\"wp-image-18756\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/2-17.png 654w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/2-17-300x104.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/2-17-600x207.png 600w\" sizes=\"auto, (max-width: 654px) 100vw, 654px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0a\u8ff0\u914d\u7f6e\u7406\u89e3\u4e3a\uff1a\u5982\u679c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u4ec0\u4e48\u8def\u7531\u90fd\u4e0d\u52a0\uff0c\u90a3\u4e48\u8bf7\u6c42\u5230abc\/index.html\uff0c\u5982\u679c\u8bf7\u6c42\u7684\u65f6\u5019\u52a0\u4e86\u4e00\u4e2a\u8def\u7531\uff0c\u6bd4\u5982 \u201cip\/about.txt\u201d\uff0c\u90a3\u4e48\u9996\u5148\u4f1a\u67e5\u627eabc\u8def\u5f84\u4e0b\u662f\u5426\u6709about.txt\u6587\u4ef6\uff0c\u6b64\u65f6about.txt\u5bf9\u5e94\u7684\u5c31\u662f<strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">$uri<\/mark><\/strong>\uff0c\u5982\u679c\u6ca1\u6709\u627e\u5230about.txt\uff0c\u90a3\u4e48\u7ee7\u7eed\u67e5\u627eabc\u8def\u5f84\u4e0b\u662f\u5426\u6709about.txt\u76ee\u5f55\uff0c\u8fd9\u4e2aabout.txt\u76ee\u5f55\u5bf9\u5e94\u7684\u5c31\u662f&#8221;<strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">$uri\/<\/mark><\/strong>&#8221; ,\u5982\u679c\u6709\uff0c\u90a3\u4e48\u5c31\u8bf7\u6c42about.txt\u76ee\u5f55\u7684\u5185\u5bb9\uff0c\u5982\u679c\u4e5f\u6ca1\u6709\u8fd9\u4e2a\u76ee\u5f55\uff0c\u90a3\u4e48\u5c31\u8fd4\u56de\u9ed8\u8ba4\u7684\u9875\u9762\uff0c\u4e5f\u5c31\u662f\u6700\u5f00\u59cb\u7684abc\/index.html<\/p>\n\n\n\n<p class=\"has-luminous-vivid-amber-background-color has-background wp-block-paragraph\">\u6ce8\uff1a\u627eabout.txt\u76ee\u5f55\u4e0b\u7684\u6587\u4ef6\u9ed8\u8ba4\u4e5f\u662findex.html<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e3e\u4f8b\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">(1)\u3001\u5982\u679c\u4ec0\u4e48\u8def\u5f84\u90fd\u4e0d\u52a0\uff0c\u76f4\u63a5\u4f7f\u7528IP\u8bbf\u95ee\uff0c\u9ed8\u8ba4\u4f1a\u627e\u5230abc\u4e0b\u7684index.html\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/3-15.png\" alt=\"\" class=\"wp-image-18757\" style=\"width:840px;height:171px\" width=\"840\" height=\"171\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">(2)\u3001\u5728abc\u76ee\u5f55\u4e0b\u5b9a\u4e49about.txt\u76ee\u5f55\uff0c\u5728\u6b64\u76ee\u5f55\u4e0b\u5b9a\u4e49index.html\u6587\u4ef6\uff0c\u5199\u5165\u5185\u5bb9\uff0c\u901a\u8fc7ip\/about.txt\u8bbf\u95ee\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"659\" height=\"185\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/5-15.png\" alt=\"\" class=\"wp-image-18763\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/5-15.png 659w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/5-15-300x84.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/5-15-600x168.png 600w\" sizes=\"auto, (max-width: 659px) 100vw, 659px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u56e0\u4e3aabc\u76ee\u5f55\u4e0b\u6ca1\u6709about.txt\u6587\u4ef6\uff0c\u4f46\u662f\u6709about.txt\u76ee\u5f55\uff0c\u56e0\u6b64\u8df3\u8fc7$uri\uff0c\u7ee7\u7eed\u627e$uri\/\uff0c\u627e\u5230\u4e86\u5e76\u8fd4\u56de\u7ed3\u679c<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">(3)\u3001\u5728abc\u76ee\u5f55\u4e0b\u5b9a\u4e49test.txt\u6587\u4ef6\uff0c\u5199\u5165\u5185\u5bb9\uff0c\u6b64\u65f6\u901a\u8fc7ip\/test.txt\u8bbf\u95ee\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"652\" height=\"194\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/6-15.png\" alt=\"\" class=\"wp-image-18767\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/6-15.png 652w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/6-15-300x89.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/6-15-600x179.png 600w\" sizes=\"auto, (max-width: 652px) 100vw, 652px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u6b64\u65f6\u7b26\u5408\u4e86\u7b2c\u4e00\u4e2a$uri\uff0c\u56e0\u6b64\u4e0d\u4f1a\u7ee7\u7eed\u5411\u540e\u9762\u67e5\u627e\u4e86<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">(4)\u3001\u76f4\u63a5\u901a\u8fc7ip\u8bf7\u6c42\u672a\u77e5\u7684\u8d44\u6e90\u8def\u5f84\uff0cip\/gong.doc\uff0c\u56de\u5230\u4e86\u9ed8\u8ba4\u9875\u9762\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"648\" height=\"206\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/7-13.png\" alt=\"\" class=\"wp-image-18768\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/7-13.png 648w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/7-13-300x95.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/7-13-600x191.png 600w\" sizes=\"auto, (max-width: 648px) 100vw, 648px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u56e0\u4e3aabc\u8def\u5f84\u4e0b\u4e0d\u5b58\u5728gong.doc\u4e5f\u4e0d\u5b58\u5728\u8fd9\u4e2a\u76ee\u5f55\uff0c\u56e0\u6b64\u5c31\u4f1a\u627e\u5230\u6700\u7ec8\u7684\/index.html<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">2\u3001<strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">\u68c0\u67e5\u9759\u6001\u6587\u4ef6\u662f\u5426\u5b58\u5728\uff0c\u4e0d\u5b58\u5728\u5219\u8f6c\u53d1\u5230\u540e\u7aef\u5e94\u7528<\/mark><\/strong>\uff0c\u6e90nginx\u7684\u914d\u7f6e\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"652\" height=\"342\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/1-19.png\" alt=\"\" class=\"wp-image-18773\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/1-19.png 652w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/1-19-300x157.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/1-19-600x315.png 600w\" sizes=\"auto, (max-width: 652px) 100vw, 652px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0a\u56fe\u4e2d\u7684\u914d\u7f6e\u53ef\u4ee5\u7406\u89e3\u4e3a\u5982\u679c\u8bf7\u6c42\u7684\u8def\u7531\u4e0d\u5339\u914d$uri\u548c$uri\/\uff0c\u90a3\u4e48\u4f1a\u8f6c\u53d1\u5230@backend\u7684\u540e\u7aef\u670d\u52a1\uff0c\u8fd9\u4e2abackend\u540d\u79f0\u662f\u81ea\u5b9a\u4e49\u7684\uff0c\u56e0\u6b64\u5982\u679c\u8bf7\u6c42http:\/\/192.168.49.83\/test_route\u7684\u65f6\u5019\uff0c\u4f46\u662f\u672c\u5730\u6ca1\u6709\u5bf9\u5e94\u7684\u5339\u914d\uff0c\u56e0\u6b64\u4f1a\u8f6c\u53d1\u5230<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">http:\/\/192.168.49.224\/test_route<\/mark>\uff0c\u8fd9\u4e2a<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">test_route<\/mark>\u4f1a\u5e26\u5230\u540e\u7aef\u53bb\u7684<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u91cc\u8fd8\u662f\u4ee5\u4e24\u4e2anginx\u7684\u9759\u6001\u9875\u9762\u4e3e\u4f8b\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">(1)\u3001\u4fee\u653949.224\u7684nginx\u914d\u7f6e\u6587\u4ef6\uff0c\u6dfb\u52a0\u5185\u5bb9\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"652\" height=\"119\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/2-18.png\" alt=\"\" class=\"wp-image-18775\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/2-18.png 652w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/2-18-300x55.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/2-18-600x110.png 600w\" sizes=\"auto, (max-width: 652px) 100vw, 652px\" \/><\/figure>\n\n\n\n<p class=\"has-luminous-vivid-amber-background-color has-background wp-block-paragraph\">\u6ce8\uff1a\u5728\u540e\u7aef\u7684nginx\u914d\u7f6e\u4e2d\uff0c\u4e5f\u8981\u6709\u8fd9\u4e2atest_route\u8def\u7531\uff0c\u5426\u5219\u4f1a\u62a5404\u9519\u8bef<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">(2)\u3001\u5728\/data\/html\u76ee\u5f55\u4e0b\u65b0\u5efatest_route\u76ee\u5f55\u5e76\u5b9a\u4e49index.html\u6587\u4ef6\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"649\" height=\"311\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/3-16.png\" alt=\"\" class=\"wp-image-18776\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/3-16.png 649w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/3-16-300x144.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/3-16-600x288.png 600w\" sizes=\"auto, (max-width: 649px) 100vw, 649px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">(3)\u3001\u6b64\u65f6\u901a\u8fc7\u6e90IP\u6765\u8bf7\u6c42test_route\u8def\u7531\uff0c\u56e0\u4e3a\u5f53\u524d\u6ca1\u6709\u5339\u914d\uff0c\u5c31\u56de\u8df3\u8f6c\u5230\u540e\u7aef\u670d\u52a1\u53bb\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"653\" height=\"146\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/4-17.png\" alt=\"\" class=\"wp-image-18778\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/4-17.png 653w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/4-17-300x67.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/4-17-600x134.png 600w\" sizes=\"auto, (max-width: 653px) 100vw, 653px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0a\u8ff0NGINX\u914d\u7f6e\u4e2d\u6709\u4e2a\u53c2\u6570\uff0c\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>add_header X-Tried-File $uri always; #always\u8868\u793a\u5bf9\u6240\u6709\u54cd\u5e94\u6709\u6548<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u6b64\u53c2\u6570\u7684\u610f\u601d\u662f\u5728 <strong class=\"\">HTTP \u54cd\u5e94\u5934<\/strong> \u4e2d\u65b0\u589e\u4e00\u4e2a\u81ea\u5b9a\u4e49\u5934\u5b57\u6bb5 <code>X-Tried-File<\/code>\uff0c\u5176\u503c\u4e3a <strong class=\"\">\u7528\u6237\u5b9e\u9645\u8bf7\u6c42\u7684\u6587\u4ef6\u8def\u5f84<\/strong>\uff08\u5373 <code>$uri<\/code> \u53d8\u91cf\uff09\uff0c\u67e5\u770b\u54cd\u5e94\u5934\u4fe1\u606f\uff0c\u53ef\u4ee5\u770b\u5230X-Tried-File\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"649\" height=\"335\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/5-16.png\" alt=\"\" class=\"wp-image-18782\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/5-16.png 649w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/5-16-300x155.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/5-16-600x310.png 600w\" sizes=\"auto, (max-width: 649px) 100vw, 649px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">3\u3001<strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">\u68c0\u67e5\u9759\u6001\u6587\u4ef6\u662f\u5426\u5b58\u5728\uff0c\u4e0d\u5b58\u5728\u76f4\u63a5\u8fd4\u56de404<\/mark><\/strong>\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"653\" height=\"271\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/6-16.png\" alt=\"\" class=\"wp-image-18784\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/6-16.png 653w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/6-16-300x125.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/6-16-600x249.png 600w\" sizes=\"auto, (max-width: 653px) 100vw, 653px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u8bf7\u6c42gong.txt\uff0c\u65e2\u4e0d\u5b58\u5728\u6b64\u6587\u4ef6\u4e5f\u4e0d\u5b58\u5728\u6b64\u76ee\u5f55\uff0c\u56e0\u6b64\u76f4\u63a5\u8fd4\u56de404\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"651\" height=\"251\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/7-14.png\" alt=\"\" class=\"wp-image-18786\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/7-14.png 651w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/7-14-300x116.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/7-14-600x231.png 600w\" sizes=\"auto, (max-width: 651px) 100vw, 651px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">4\u3001<strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">\u8bbf\u95ee\u9875\u9762\uff0c\u76f4\u63a5\u8fd4\u56de\u72b6\u6001\u7801\uff0c\u9002\u5408\u7ef4\u62a4\u9875\u9762<\/mark><\/strong>\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"647\" height=\"251\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/8-12.png\" alt=\"\" class=\"wp-image-18789\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/8-12.png 647w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/8-12-300x116.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/8-12-600x233.png 600w\" sizes=\"auto, (max-width: 647px) 100vw, 647px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728abc\u76ee\u5f55\u4e0b\u5b9a\u4e49maintenace.html(<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\"><strong>\u540d\u5b57\u8981\u4e0enginx\u914d\u7f6e\u540d\u5b57\u4e00\u81f4<\/strong><\/mark>)\uff0c\u7136\u540e\u901a\u8fc7192.168.49.83\u8bf7\u6c42\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"650\" height=\"153\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/3-17.png\" alt=\"\" class=\"wp-image-18797\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/3-17.png 650w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/3-17-300x71.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/3-17-600x141.png 600w\" sizes=\"auto, (max-width: 650px) 100vw, 650px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">5\u3001<strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">\u5d4c\u5957\u6761\u4ef6<\/mark><\/strong>\uff0c\u4fee\u6539nginx\u914d\u7f6e\u6587\u4ef6\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"651\" height=\"260\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/10-5.png\" alt=\"\" class=\"wp-image-18791\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/10-5.png 651w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/10-5-300x120.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/10-5-600x240.png 600w\" sizes=\"auto, (max-width: 651px) 100vw, 651px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0a\u9762\u914d\u7f6e\u7406\u89e3\u4e3a\uff1a\u5982\u679c\u8bf7\u6c42\/hello\uff0c\u90a3\u4e48\u5339\u914d\/custom\/hello\uff0c\u5982\u679c\u5339\u914d\u4e0d\u5230\u5c31\u7ee7\u7eed\u5339\u914d\/default\/hello\uff0c\u5982\u679c\u90fd\u5339\u914d\u4e0d\u5230\u5c31\u8fd4\u56de404<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e3e\u4f8b\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728abc\u76ee\u5f55\u4e0b\u65b0\u5efacustom\u76ee\u5f55\u5e76\u5728\u5185\u90e8\u521b\u5efagong.txt\u6587\u4ef6\uff0c\u65b0\u5efadefault\u76ee\u5f55\u5e76\u5728\u5185\u90e8\u65b0\u5efaguan.txt\uff0c\u901a\u8fc7url\u8bf7\u6c42\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"651\" height=\"168\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/1-20.png\" alt=\"\" class=\"wp-image-18793\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/1-20.png 651w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/1-20-300x77.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/1-20-600x155.png 600w\" sizes=\"auto, (max-width: 651px) 100vw, 651px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"654\" height=\"176\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/2-19.png\" alt=\"\" class=\"wp-image-18794\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/2-19.png 654w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/2-19-300x81.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2025\/07\/2-19-600x161.png 600w\" sizes=\"auto, (max-width: 654px) 100vw, 654px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728 Nginx \u4e2d\uff0ctry_files&nbsp;\u662f\u4e00\u4e2a\u6781\u4e3a\u5b9e\u7528\u7684\u6307\u4ee4\uff0c\u4e3b\u8981\u7528\u4e8e \u200b\u200b\u6309\u987a\u5e8f\u68c0\u67e5\u6587\u4ef6\u6216\u8def\u5f84\u662f\u5426 [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":18760,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34],"tags":[],"class_list":["post-18753","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":8}},"_links":{"self":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/18753","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/comments?post=18753"}],"version-history":[{"count":23,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/18753\/revisions"}],"predecessor-version":[{"id":18798,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/18753\/revisions\/18798"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/media\/18760"}],"wp:attachment":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/media?parent=18753"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/categories?post=18753"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/tags?post=18753"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}