{"id":33419,"date":"2023-09-07T17:37:14","date_gmt":"2023-04-30T03:20:59","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%a6%82%e6%9e%9c%e5%9c%a8nginx%e7%9a%84location%e5%9d%97%e4%b8%ad%e5%90%8c%e6%97%b6%e4%bd%bf%e7%94%a8limit_except%e5%92%8ctry_files%ef%bc%8c%e4%bc%9a%e5%af%bc%e8%87%b4%e5%87%ba%e7%8e%b0404-not-found\/"},"modified":"2024-01-15T07:48:40","modified_gmt":"2024-01-14T23:48:40","slug":"%e5%a6%82%e6%9e%9c%e5%9c%a8nginx%e7%9a%84location%e5%9d%97%e4%b8%ad%e5%90%8c%e6%97%b6%e4%bd%bf%e7%94%a8limit_except%e5%92%8ctry_files%ef%bc%8c%e4%bc%9a%e5%af%bc%e8%87%b4%e5%87%ba%e7%8e%b0404-not-found","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%a6%82%e6%9e%9c%e5%9c%a8nginx%e7%9a%84location%e5%9d%97%e4%b8%ad%e5%90%8c%e6%97%b6%e4%bd%bf%e7%94%a8limit_except%e5%92%8ctry_files%ef%bc%8c%e4%bc%9a%e5%af%bc%e8%87%b4%e5%87%ba%e7%8e%b0404-not-found\/","title":{"rendered":"\u5982\u679c\u5728nginx\u7684location\u5757\u4e2d\u540c\u65f6\u4f7f\u7528limit_except\u548ctry_files\uff0c\u4f1a\u5bfc\u81f4\u51fa\u73b0404 Not Found\u9519\u8bef"},"content":{"rendered":"<h2>\u51c6\u5907\u4e0a\u6e38<\/h2>\n<p>\u51c6\u5907\u4e00\u4e2a\u7b80\u5355\u7684Sinatra\u5e94\u7528\u7a0b\u5e8f\u6765\u54cd\u5e94GET \/app\u548cPOST \/app\u3002<\/p>\n<pre class=\"post-pre\"><code>$ rbenv local 2.3.0\r\n$ cat &lt;&lt;EOF &gt; Gemfile\r\nsource 'https:\/\/rubygems.org'\r\n\r\nruby '2.3.0'\r\n\r\ngem 'sinatra'\r\ngem 'thin'\r\ngem 'rack-cors', require: 'rack\/cors'\r\nEOF\r\n$ bundle install\r\n$ cat &lt;&lt;EOF &gt; app.rb\r\nrequire 'sinatra'\r\n\r\nget '\/app' do\r\n  'GET'\r\nend\r\n\r\npost '\/app' do\r\n  'POST'\r\nend\r\nEOF\r\n$ cat &lt;&lt;EOF &gt; config.ru\r\nrequire '.\/app'\r\nrun Sinatra::Application\r\nEOF\r\n$ bundle exec rackup -p 3000\r\n$ curl http:\/\/localhost:3000\/app\r\nGET\r\n$ curl -X POST http:\/\/localhost:3000\/app\r\nPOST\r\n<\/code><\/pre>\n<h2>\u51c6\u5907\u4f7f\u7528try_files\u6307\u4ee4\u8fdb\u884c\u5185\u90e8\u91cd\u5b9a\u5411\u3002<\/h2>\n<p>\u5982\u679cURL\u8def\u5f84\u6ca1\u6709\u5bf9\u5e94\u7684\u6587\u4ef6\uff0c\u5219\u5c06\u5176\u91cd\u5b9a\u5411\u5230\u4e0a\u6e38\u3002<\/p>\n<pre class=\"post-pre\"><code>$ curl -L -O http:\/\/downloads.sourceforge.net\/project\/pcre\/pcre\/8.38\/pcre-8.38.tar.bz2\r\n$ tar -xjvf pcre-8.38.tar.bz2\r\n$ nginx-build -d . -clear --with-pcre=$(pwd)\/pcre-8.38\r\n$ mkdir logs conf\r\n$ cp nginx\/1.9.15\/nginx-1.9.15\/conf\/mime.types .\/conf\r\n$ cat &lt;&lt;EOF &gt; conf\/nginx.conf\r\nworker_processes 1;\r\n\r\nevents {\r\n    worker_connections 1024;\r\n}\r\n\r\nhttp {\r\n    include mime.types;\r\n\r\n    upstream app {\r\n        server localhost:3000;\r\n    }\r\n\r\n    server {\r\n        listen 8000;\r\n        server_name localhost;\r\n        root html;\r\n\r\n        location \/ {\r\n            try_files $uri $uri\/index.html $uri.html @app;\r\n        }\r\n\r\n        location @app {\r\n            proxy_pass http:\/\/app;\r\n        }\r\n    }\r\n}\r\nEOF\r\n$ mkdir html\r\n$ echo html &gt; html\/index.html\r\n$ .\/nginx\/1.9.15\/nginx-1.9.15\/objs\/nginx -p $(pwd) -c conf\/nginx.conf\r\n$ curl http:\/\/localhost:8000\/index.html\r\nhtml\r\n$ curl http:\/\/localhost:8000\/app\r\nGET\r\n$ curl -X POST http:\/\/localhost:8000\/app\r\nPOST\r\n<\/code><\/pre>\n<h2>\u8a2d\u7f6e\u57fa\u672c\u8a8d\u8b49<\/h2>\n<p>\u5728\u9650\u5236\u6761\u4ef6\u4e4b\u524d\uff0c\u65e0\u8bba\u8bf7\u6c42\u65b9\u6cd5\u5982\u4f55\uff0c\u5c1d\u8bd5\u5bf9\u6240\u6709\u5185\u5bb9\u8fdb\u884c\u57fa\u672c\u8ba4\u8bc1\u3002<\/p>\n<pre class=\"post-pre\"><code>$ cp conf\/nginx.conf conf\/nginx.conf.orig\r\n$ vi conf\/nginx.conf\r\n$ diff -u conf\/nginx.conf.orig conf\/nginx.conf\r\n--- conf\/nginx.conf.orig    2016-04-23 16:31:35.000000000 +0900\r\n+++ conf\/nginx.conf 2016-04-23 16:48:22.000000000 +0900\r\n@@ -18,6 +18,8 @@\r\n\r\n         location \/ {\r\n             try_files $uri $uri\/index.html $uri.html @app;\r\n+            auth_basic \"Basic auth\";\r\n+            auth_basic_user_file .htpasswd;\r\n         }\r\n\r\n         location @app {\r\n$ echo \"user:$(openssl passwd -apr1 password)\" &gt; conf\/.htpasswd\r\n$ .\/nginx\/1.9.15\/nginx-1.9.15\/objs\/nginx -p $(pwd) -c conf\/nginx.conf -s reload\r\n$ curl -u 'user:password' http:\/\/localhost:8000\/app\r\nGET\r\n$ curl -X POST -u 'user:password' http:\/\/localhost:8000\/app\r\nPOST\r\n<\/code><\/pre>\n<h2>\u53ea\u5141\u8bb8\u4f7f\u7528 limit_except \u6765\u5bf9 POST \u8bf7\u6c42\u8fdb\u884c\u57fa\u672c\u8ba4\u8bc1\u3002<\/h2>\n<p>\u53ea\u6709\u5728POST\u8bf7\u6c42\u65b9\u6cd5\u65f6\u624d\u9700\u8981\u8fdb\u884c\u57fa\u672c\u8ba4\u8bc1\u3002<\/p>\n<pre class=\"post-pre\"><code>$ vi conf\/nginx.conf\r\n$ diff -u conf\/nginx.conf.orig conf\/nginx.conf\r\n--- conf\/nginx.conf.orig    2016-04-23 16:31:35.000000000 +0900\r\n+++ conf\/nginx.conf 2016-04-23 16:51:08.000000000 +0900\r\n@@ -18,6 +18,10 @@\r\n\r\n         location \/ {\r\n             try_files $uri $uri\/index.html $uri.html @app;\r\n+            limit_except GET {\r\n+                auth_basic \"Basic auth\";\r\n+                auth_basic_user_file .htpasswd;\r\n+            }\r\n         }\r\n\r\n         location @app {\r\n$ .\/nginx\/1.9.15\/nginx-1.9.15\/objs\/nginx -p $(pwd) -c conf\/nginx.conf -s reload\r\n$ curl http:\/\/localhost:8000\/app\r\nGET\r\n$ curl -i -X POST -u 'user:password' http:\/\/localhost:8000\/app\r\nHTTP\/1.1 404 Not Found\r\nServer: nginx\/1.9.15\r\nDate: Sat, 23 Apr 2016 07:51:33 GMT\r\nContent-Type: text\/html\r\nContent-Length: 169\r\nConnection: keep-alive\r\n\r\n&lt;html&gt;\r\n&lt;head&gt;&lt;title&gt;404 Not Found&lt;\/title&gt;&lt;\/head&gt;\r\n&lt;body bgcolor=\"white\"&gt;\r\n&lt;center&gt;&lt;h1&gt;404 Not Found&lt;\/h1&gt;&lt;\/center&gt;\r\n&lt;hr&gt;&lt;center&gt;nginx\/1.9.15&lt;\/center&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/code><\/pre>\n<h2>404 \u9875\u9762\u672a\u627e\u5230<\/h2>\n<p>\u4e3a\u4ec0\u4e48\uff1f<\/p>\n<p>\u987a\u4fbf\u8bf4\u4e00\u4e0b\uff0c\u4e0d\u7ba1\u662f\u4f7f\u7528\u57fa\u672c\u8eab\u4efd\u9a8c\u8bc1\u8fd8\u662f\u4e0e\u4e4b\u76f8\u5173\u7684\uff0c\u53ea\u8981\u4f7f\u7528limit_except\u6307\u4ee4\uff0c\u5c31\u4f1a\u76f4\u63a5\u8fd4\u56de404 Not Found\u3002<\/p>\n<pre class=\"post-pre\"><code>$ vi conf\/nginx.conf\r\n$ diff -u conf\/nginx.conf.orig conf\/nginx.conf\r\n--- conf\/nginx.conf.orig    2016-04-23 16:31:35.000000000 +0900\r\n+++ conf\/nginx.conf 2016-04-23 16:54:31.000000000 +0900\r\n@@ -18,6 +18,8 @@\r\n\r\n         location \/ {\r\n             try_files $uri $uri\/index.html $uri.html @app;\r\n+            limit_except GET {\r\n+            }\r\n         }\r\n\r\n         location @app {\r\n$ .\/nginx\/1.9.15\/nginx-1.9.15\/objs\/nginx -p $(pwd) -c conf\/nginx.conf -s reload\r\n$ curl http:\/\/localhost:8000\/app\r\nGET\r\n$ curl -i -X POST -u 'user:password' http:\/\/localhost:8000\/app\r\nHTTP\/1.1 404 Not Found\r\nServer: nginx\/1.9.15\r\nDate: Sat, 23 Apr 2016 07:51:33 GMT\r\nContent-Type: text\/html\r\nContent-Length: 169\r\nConnection: keep-alive\r\n\r\n&lt;html&gt;\r\n&lt;head&gt;&lt;title&gt;404 Not Found&lt;\/title&gt;&lt;\/head&gt;\r\n&lt;body bgcolor=\"white\"&gt;\r\n&lt;center&gt;&lt;h1&gt;404 Not Found&lt;\/h1&gt;&lt;\/center&gt;\r\n&lt;hr&gt;&lt;center&gt;nginx\/1.9.15&lt;\/center&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/code><\/pre>\n<h2>\u5c06 &#8220;limit_except&#8221; \u79fb\u52a8\u5230\u53e6\u4e00\u4e2a &#8220;location&#8221;\u3002<\/h2>\n<p>\u4f7f\u7528limit_except\u6307\u4ee4\u5728try_files\u6307\u4ee4\u7684\u5185\u90e8\u91cd\u5b9a\u5411\u4f4d\u7f6e\u6307\u4ee4\u4e2d\uff0c\u4fbf\u4e0d\u4f1a\u8fd4\u56de404 Not Found\u3002<\/p>\n<pre class=\"post-pre\"><code>$ vi conf\/nginx.conf\r\n$ diff -u conf\/nginx.conf.orig conf\/nginx.conf\r\n--- conf\/nginx.conf.orig    2016-04-23 16:31:35.000000000 +0900\r\n+++ conf\/nginx.conf 2016-04-23 16:58:00.000000000 +0900\r\n@@ -21,6 +21,10 @@\r\n         }\r\n\r\n         location @app {\r\n+            limit_except GET {\r\n+                auth_basic \"Basic auth\";\r\n+                auth_basic_user_file .htpasswd;\r\n+            }\r\n             proxy_pass http:\/\/app;\r\n         }\r\n     }\r\n$ .\/nginx\/1.9.15\/nginx-1.9.15\/objs\/nginx -p $(pwd) -c conf\/nginx.conf -s reload\r\n$ curl http:\/\/localhost:8000\/app\r\nGET\r\n$ curl -X POST -u 'user:password' http:\/\/localhost:8000\/app\r\nPOST\r\n<\/code><\/pre>\n<h2>\u603b\u7ed3<\/h2>\n<p>\u8fd9\u662f\u600e\u6837\u7684\u60c5\u51b5\u5462\uff1f<br \/>\n\u53ef\u80fd\u662f\u6211\u627e\u6587\u6863\u7684\u65b9\u6cd5\u6709\u95ee\u9898\uff0c\u627e\u4e0d\u5230\u76f8\u5173\u7684\u8bf4\u660e\u3002<br \/>\n\u5982\u679c\u9605\u8bfb\u6e90\u4ee3\u7801\u7684\u8bdd\u53ef\u80fd\u4f1a\u660e\u767d\uff0c\u4f46\u662f\u56e0\u4e3a\u89c9\u5f97\u9ebb\u70e6\uff0c\u6240\u4ee5\u60f3\u7528\u4e00\u79cd\u7b80\u5355\u5374\u884c\u5f97\u901a\u7684\u65b9\u6cd5\u6765\u5e94\u4ed8\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u51c6\u5907\u4e0a\u6e38 \u51c6\u5907\u4e00\u4e2a\u7b80\u5355\u7684Sinatra\u5e94\u7528\u7a0b\u5e8f\u6765\u54cd\u5e94GET \/app\u548cPOST \/app\u3002 $ rbenv l [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-33419","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5982\u679c\u5728nginx\u7684location\u5757\u4e2d\u540c\u65f6\u4f7f\u7528limit_except\u548ctry_files\uff0c\u4f1a\u5bfc\u81f4\u51fa\u73b0404 Not Found\u9519\u8bef - Blog - Silicon Cloud<\/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.silicloud.com\/zh\/blog\/\u5982\u679c\u5728nginx\u7684location\u5757\u4e2d\u540c\u65f6\u4f7f\u7528limit_except\u548ctry_files\uff0c\u4f1a\u5bfc\u81f4\u51fa\u73b0404-not-found\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5982\u679c\u5728nginx\u7684location\u5757\u4e2d\u540c\u65f6\u4f7f\u7528limit_except\u548ctry_files\uff0c\u4f1a\u5bfc\u81f4\u51fa\u73b0404 Not Found\u9519\u8bef\" \/>\n<meta property=\"og:description\" content=\"\u51c6\u5907\u4e0a\u6e38 \u51c6\u5907\u4e00\u4e2a\u7b80\u5355\u7684Sinatra\u5e94\u7528\u7a0b\u5e8f\u6765\u54cd\u5e94GET \/app\u548cPOST \/app\u3002 $ rbenv l [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u5982\u679c\u5728nginx\u7684location\u5757\u4e2d\u540c\u65f6\u4f7f\u7528limit_except\u548ctry_files\uff0c\u4f1a\u5bfc\u81f4\u51fa\u73b0404-not-found\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-04-30T03:20:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-14T23:48:40+00:00\" \/>\n<meta name=\"author\" content=\"\u6e05, \u5b87\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u6e05, \u5b87\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%a6%82%e6%9e%9c%e5%9c%a8nginx%e7%9a%84location%e5%9d%97%e4%b8%ad%e5%90%8c%e6%97%b6%e4%bd%bf%e7%94%a8limit_except%e5%92%8ctry_files%ef%bc%8c%e4%bc%9a%e5%af%bc%e8%87%b4%e5%87%ba%e7%8e%b0404-not-found\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%a6%82%e6%9e%9c%e5%9c%a8nginx%e7%9a%84location%e5%9d%97%e4%b8%ad%e5%90%8c%e6%97%b6%e4%bd%bf%e7%94%a8limit_except%e5%92%8ctry_files%ef%bc%8c%e4%bc%9a%e5%af%bc%e8%87%b4%e5%87%ba%e7%8e%b0404-not-found\/\",\"name\":\"\u5982\u679c\u5728nginx\u7684location\u5757\u4e2d\u540c\u65f6\u4f7f\u7528limit_except\u548ctry_files\uff0c\u4f1a\u5bfc\u81f4\u51fa\u73b0404 Not Found\u9519\u8bef - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-04-30T03:20:59+00:00\",\"dateModified\":\"2024-01-14T23:48:40+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/1a6ecd3d914d22a5ac32791ffc1fbd8e\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%a6%82%e6%9e%9c%e5%9c%a8nginx%e7%9a%84location%e5%9d%97%e4%b8%ad%e5%90%8c%e6%97%b6%e4%bd%bf%e7%94%a8limit_except%e5%92%8ctry_files%ef%bc%8c%e4%bc%9a%e5%af%bc%e8%87%b4%e5%87%ba%e7%8e%b0404-not-found\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%a6%82%e6%9e%9c%e5%9c%a8nginx%e7%9a%84location%e5%9d%97%e4%b8%ad%e5%90%8c%e6%97%b6%e4%bd%bf%e7%94%a8limit_except%e5%92%8ctry_files%ef%bc%8c%e4%bc%9a%e5%af%bc%e8%87%b4%e5%87%ba%e7%8e%b0404-not-found\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%a6%82%e6%9e%9c%e5%9c%a8nginx%e7%9a%84location%e5%9d%97%e4%b8%ad%e5%90%8c%e6%97%b6%e4%bd%bf%e7%94%a8limit_except%e5%92%8ctry_files%ef%bc%8c%e4%bc%9a%e5%af%bc%e8%87%b4%e5%87%ba%e7%8e%b0404-not-found\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5982\u679c\u5728nginx\u7684location\u5757\u4e2d\u540c\u65f6\u4f7f\u7528limit_except\u548ctry_files\uff0c\u4f1a\u5bfc\u81f4\u51fa\u73b0404 Not Found\u9519\u8bef\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/1a6ecd3d914d22a5ac32791ffc1fbd8e\",\"name\":\"\u6e05, \u5b87\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/4b2016c18459a605fc469c7566608f5686491baa112d0871ee613f61b7210565?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/4b2016c18459a605fc469c7566608f5686491baa112d0871ee613f61b7210565?s=96&d=mm&r=g\",\"caption\":\"\u6e05, \u5b87\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/qingyu\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%a6%82%e6%9e%9c%e5%9c%a8nginx%e7%9a%84location%e5%9d%97%e4%b8%ad%e5%90%8c%e6%97%b6%e4%bd%bf%e7%94%a8limit_except%e5%92%8ctry_files%ef%bc%8c%e4%bc%9a%e5%af%bc%e8%87%b4%e5%87%ba%e7%8e%b0404-not-found\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u5982\u679c\u5728nginx\u7684location\u5757\u4e2d\u540c\u65f6\u4f7f\u7528limit_except\u548ctry_files\uff0c\u4f1a\u5bfc\u81f4\u51fa\u73b0404 Not Found\u9519\u8bef - Blog - Silicon Cloud","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.silicloud.com\/zh\/blog\/\u5982\u679c\u5728nginx\u7684location\u5757\u4e2d\u540c\u65f6\u4f7f\u7528limit_except\u548ctry_files\uff0c\u4f1a\u5bfc\u81f4\u51fa\u73b0404-not-found\/","og_locale":"zh_CN","og_type":"article","og_title":"\u5982\u679c\u5728nginx\u7684location\u5757\u4e2d\u540c\u65f6\u4f7f\u7528limit_except\u548ctry_files\uff0c\u4f1a\u5bfc\u81f4\u51fa\u73b0404 Not Found\u9519\u8bef","og_description":"\u51c6\u5907\u4e0a\u6e38 \u51c6\u5907\u4e00\u4e2a\u7b80\u5355\u7684Sinatra\u5e94\u7528\u7a0b\u5e8f\u6765\u54cd\u5e94GET \/app\u548cPOST \/app\u3002 $ rbenv l [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u5982\u679c\u5728nginx\u7684location\u5757\u4e2d\u540c\u65f6\u4f7f\u7528limit_except\u548ctry_files\uff0c\u4f1a\u5bfc\u81f4\u51fa\u73b0404-not-found\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-04-30T03:20:59+00:00","article_modified_time":"2024-01-14T23:48:40+00:00","author":"\u6e05, \u5b87","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u6e05, \u5b87","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%a6%82%e6%9e%9c%e5%9c%a8nginx%e7%9a%84location%e5%9d%97%e4%b8%ad%e5%90%8c%e6%97%b6%e4%bd%bf%e7%94%a8limit_except%e5%92%8ctry_files%ef%bc%8c%e4%bc%9a%e5%af%bc%e8%87%b4%e5%87%ba%e7%8e%b0404-not-found\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%a6%82%e6%9e%9c%e5%9c%a8nginx%e7%9a%84location%e5%9d%97%e4%b8%ad%e5%90%8c%e6%97%b6%e4%bd%bf%e7%94%a8limit_except%e5%92%8ctry_files%ef%bc%8c%e4%bc%9a%e5%af%bc%e8%87%b4%e5%87%ba%e7%8e%b0404-not-found\/","name":"\u5982\u679c\u5728nginx\u7684location\u5757\u4e2d\u540c\u65f6\u4f7f\u7528limit_except\u548ctry_files\uff0c\u4f1a\u5bfc\u81f4\u51fa\u73b0404 Not Found\u9519\u8bef - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-04-30T03:20:59+00:00","dateModified":"2024-01-14T23:48:40+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/1a6ecd3d914d22a5ac32791ffc1fbd8e"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%a6%82%e6%9e%9c%e5%9c%a8nginx%e7%9a%84location%e5%9d%97%e4%b8%ad%e5%90%8c%e6%97%b6%e4%bd%bf%e7%94%a8limit_except%e5%92%8ctry_files%ef%bc%8c%e4%bc%9a%e5%af%bc%e8%87%b4%e5%87%ba%e7%8e%b0404-not-found\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e5%a6%82%e6%9e%9c%e5%9c%a8nginx%e7%9a%84location%e5%9d%97%e4%b8%ad%e5%90%8c%e6%97%b6%e4%bd%bf%e7%94%a8limit_except%e5%92%8ctry_files%ef%bc%8c%e4%bc%9a%e5%af%bc%e8%87%b4%e5%87%ba%e7%8e%b0404-not-found\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%a6%82%e6%9e%9c%e5%9c%a8nginx%e7%9a%84location%e5%9d%97%e4%b8%ad%e5%90%8c%e6%97%b6%e4%bd%bf%e7%94%a8limit_except%e5%92%8ctry_files%ef%bc%8c%e4%bc%9a%e5%af%bc%e8%87%b4%e5%87%ba%e7%8e%b0404-not-found\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u5982\u679c\u5728nginx\u7684location\u5757\u4e2d\u540c\u65f6\u4f7f\u7528limit_except\u548ctry_files\uff0c\u4f1a\u5bfc\u81f4\u51fa\u73b0404 Not Found\u9519\u8bef"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/1a6ecd3d914d22a5ac32791ffc1fbd8e","name":"\u6e05, \u5b87","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/4b2016c18459a605fc469c7566608f5686491baa112d0871ee613f61b7210565?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4b2016c18459a605fc469c7566608f5686491baa112d0871ee613f61b7210565?s=96&d=mm&r=g","caption":"\u6e05, \u5b87"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/qingyu\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%a6%82%e6%9e%9c%e5%9c%a8nginx%e7%9a%84location%e5%9d%97%e4%b8%ad%e5%90%8c%e6%97%b6%e4%bd%bf%e7%94%a8limit_except%e5%92%8ctry_files%ef%bc%8c%e4%bc%9a%e5%af%bc%e8%87%b4%e5%87%ba%e7%8e%b0404-not-found\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/33419","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=33419"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/33419\/revisions"}],"predecessor-version":[{"id":57506,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/33419\/revisions\/57506"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=33419"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=33419"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=33419"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}