{"id":53666,"date":"2024-12-03T08:18:35","date_gmt":"2024-12-03T00:18:35","guid":{"rendered":"https:\/\/fwq.ai\/blog\/53666\/"},"modified":"2024-12-03T08:18:35","modified_gmt":"2024-12-03T00:18:35","slug":"%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8-nginx-%e5%b0%86%e5%a4%9a%e4%b8%aa%e9%a1%b9%e7%9b%ae%e5%bd%92%e7%ba%b3%e5%88%b0%e4%b8%80%e4%b8%aa%e5%9c%b0%e5%9d%80%e5%b9%b6%e9%80%9a%e8%bf%87-url-%e5%90%8e","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/53666\/","title":{"rendered":"\u5982\u4f55\u4f7f\u7528 Nginx \u5c06\u591a\u4e2a\u9879\u76ee\u5f52\u7eb3\u5230\u4e00\u4e2a\u5730\u5740\u5e76\u901a\u8fc7 URL \u540e\u7f00\u8fdb\u884c\u5207\u6362\uff1f"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>\u5982\u4f55\u4f7f\u7528 Nginx \u5c06\u591a\u4e2a\u9879\u76ee\u5f52\u7eb3\u5230\u4e00\u4e2a\u5730\u5740\u5e76\u901a\u8fc7 URL \u540e\u7f00\u8fdb\u884c\u5207\u6362\uff1f<\/h1>\n<p>\u54c8\u55bd\uff01\u5927\u5bb6\u597d\uff0c\u5f88\u9ad8\u5174\u53c8\u89c1\u9762\u4e86\uff0c\u6211\u662f\u7c73\u4e91\u7684\u4e00\u540d\u4f5c\u8005\uff0c\u4eca\u5929\u7531\u6211\u7ed9\u5927\u5bb6\u5e26\u6765\u4e00\u7bc7<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u300a\u5982\u4f55\u4f7f\u7528 Nginx \u5c06\u591a\u4e2a\u9879\u76ee\u5f52\u7eb3\u5230\u4e00\u4e2a\u5730\u5740\u5e76\u901a\u8fc7 URL \u540e\u7f00\u8fdb\u884c\u5207\u6362\uff1f\u300b<\/span>\uff0c\u672c\u6587\u4e3b\u8981\u4f1a\u8bb2\u5230<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\"><\/span>\u7b49\u7b49\u77e5\u8bc6\u70b9\uff0c\u5e0c\u671b\u5927\u5bb6\u4e00\u8d77\u5b66\u4e60\u8fdb\u6b65\uff0c\u4e5f\u6b22\u8fce\u5927\u5bb6\u5173\u6ce8\u3001\u70b9\u8d5e\u3001\u6536\u85cf\u3001\u8f6c\u53d1! \u4e0b\u9762\u5c31\u4e00\u8d77\u6765\u770b\u770b\u5427\uff01<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241203\/1733204929674e9bc1354ab.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u4f7f\u7528 Nginx \u5c06\u591a\u4e2a\u9879\u76ee\u5f52\u7eb3\u5230\u4e00\u4e2a\u5730\u5740\u5e76\u901a\u8fc7 URL \u540e\u7f00\u8fdb\u884c\u5207\u6362\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u4f7f\u7528 Nginx \u5c06\u591a\u4e2a\u9879\u76ee\u5f52\u7eb3\u5230\u4e00\u4e2a\u5730\u5740\u5e76\u901a\u8fc7 URL \u540e\u7f00\u8fdb\u884c\u5207\u6362\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u4f7f\u7528 Nginx \u5b9e\u73b0\u5355\u5730\u5740\u5207\u6362\u7cfb\u7edf<\/strong><\/p>\n<p>\u8981\u5c06\u591a\u4e2a\u9879\u76ee\u5f52\u7eb3\u5230\u4e00\u4e2a\u5730\u5740\u4e2d\u5e76\u901a\u8fc7 URL \u540e\u7f00\u5207\u6362\u7cfb\u7edf\uff0c\u4e00\u79cd\u5e38\u7528\u7684\u65b9\u6cd5\u662f\u4f7f\u7528 Nginx \u4f5c\u4e3a\u4ee3\u7406\u8f6c\u53d1\u3002<\/p>\n<p>Nginx <strong>\u76d1\u542c<\/strong>\u7aef\u53e3 6666\u3002\u5f53\u6536\u5230\u4e00\u4e2a\u5e26\u6709\u540e\u7f00\u4e3a \/api1 \u6216 \/api2 \u7684\u8bf7\u6c42\u65f6\uff0cNginx \u5c06<strong>\u8f6c\u53d1<\/strong>\u8bf7\u6c42\u5230\u76f8\u5e94\u7684\u771f\u5b9e\u540e\u7aef\u3002\u4f8b\u5982\uff1a<\/p>\n<ul>\n<li>\/api1 \u8bf7\u6c42\u5c06\u88ab\u8f6c\u53d1\u5230 http:\/\/192.168.1.12:6666\/api1<\/li>\n<li>\/api2 \u8bf7\u6c42\u5c06\u88ab\u8f6c\u53d1\u5230 http:\/\/192.168.1.12:6666\/api2<\/li>\n<\/ul>\n<p>\u8fd9\u6837\uff0c\u60a8\u5c31\u53ef\u4ee5\u901a\u8fc7\u4fee\u6539 URL \u540e\u7f00\u6765\u5207\u6362\u5230\u4e0d\u540c\u7684\u9879\u76ee\uff0c\u800c\u65e0\u9700\u66f4\u6539\u9879\u76ee\u6216\u540e\u53f0\u3002<\/p>\n<p>\u672c\u7bc7\u5173\u4e8e\u300a\u5982\u4f55\u4f7f\u7528 Nginx \u5c06\u591a\u4e2a\u9879\u76ee\u5f52\u7eb3\u5230\u4e00\u4e2a\u5730\u5740\u5e76\u901a\u8fc7 URL \u540e\u7f00\u8fdb\u884c\u5207\u6362\uff1f\u300b\u7684\u4ecb\u7ecd\u5c31\u5230\u6b64\u7ed3\u675f\u5566\uff0c\u4f46\u662f\u5b66\u65e0\u6b62\u5883\uff0c\u60f3\u8981\u4e86\u89e3\u5b66\u4e60\u66f4\u591a\u5173\u4e8e\u6587\u7ae0\u7684\u76f8\u5173\u77e5\u8bc6\uff0c\u8bf7\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\uff01<\/p>\n<dl>\n<dt><\/dt>\n<dd>\n   PHP foreach\u5faa\u73af\u4e2d\uff0c\u5982\u4f55\u83b7\u53d6\u5f39\u6846\u5185\u6570\u636e\u7684ID\u503c\u5e76\u4f20\u9012\u5230\u5176\u4ed6\u9875\u9762\uff1f\n <\/dd>\n<\/dl>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u4f7f\u7528 Nginx \u5c06\u591a\u4e2a\u9879\u76ee\u5f52\u7eb3\u5230\u4e00\u4e2a\u5730\u5740\u5e76\u901a\u8fc7 URL \u540e\u7f00\u8fdb\u884c\u5207\u6362\uff1f \u54c8\u55bd\uff01\u5927\u5bb6\u597d\uff0c\u5f88\u9ad8\u5174\u53c8\u89c1\u9762\u4e86\uff0c\u6211\u662f\u7c73\u4e91\u7684\u4e00\u540d\u4f5c\u8005\uff0c\u4eca\u5929\u7531\u6211\u7ed9\u5927\u5bb6\u5e26\u6765\u4e00\u7bc7\u300a\u5982\u4f55\u4f7f\u7528 Nginx \u5c06\u591a\u4e2a\u9879\u76ee\u5f52\u7eb3\u5230\u4e00\u4e2a\u5730\u5740\u5e76\u901a\u8fc7 URL \u540e\u7f00\u8fdb\u884c\u5207\u6362\uff1f\u300b\uff0c\u672c\u6587\u4e3b\u8981\u4f1a\u8bb2\u5230\u7b49\u7b49\u77e5\u8bc6\u70b9\uff0c\u5e0c\u671b\u5927\u5bb6\u4e00\u8d77\u5b66\u4e60\u8fdb\u6b65\uff0c\u4e5f\u6b22\u8fce\u5927\u5bb6\u5173\u6ce8\u3001\u70b9\u8d5e\u3001\u6536\u85cf\u3001\u8f6c\u53d1! \u4e0b\u9762\u5c31\u4e00\u8d77\u6765\u770b\u770b\u5427\uff01 \u4f7f\u7528 Nginx \u5b9e\u73b0\u5355\u5730\u5740\u5207\u6362\u7cfb\u7edf \u8981\u5c06\u591a\u4e2a\u9879\u76ee\u5f52\u7eb3\u5230\u4e00\u4e2a\u5730\u5740\u4e2d\u5e76\u901a\u8fc7 URL \u540e\u7f00\u5207\u6362\u7cfb\u7edf\uff0c\u4e00\u79cd\u5e38\u7528\u7684\u65b9\u6cd5\u662f\u4f7f\u7528 Nginx \u4f5c\u4e3a\u4ee3\u7406\u8f6c\u53d1\u3002 Nginx \u76d1\u542c\u7aef\u53e3 6666\u3002\u5f53\u6536\u5230\u4e00\u4e2a\u5e26\u6709\u540e\u7f00\u4e3a \/api1 \u6216 \/api2 \u7684\u8bf7\u6c42\u65f6\uff0cNginx \u5c06\u8f6c\u53d1\u8bf7\u6c42\u5230\u76f8\u5e94\u7684\u771f\u5b9e\u540e\u7aef\u3002\u4f8b\u5982\uff1a \/api1 \u8bf7\u6c42\u5c06\u88ab\u8f6c\u53d1\u5230 http:\/\/192.168.1.12:6666\/api1 \/api2 \u8bf7\u6c42\u5c06\u88ab\u8f6c\u53d1\u5230 http:\/\/192.168.1.12:6666\/api2 \u8fd9\u6837\uff0c\u60a8\u5c31\u53ef\u4ee5\u901a\u8fc7\u4fee\u6539 URL \u540e\u7f00\u6765\u5207\u6362\u5230\u4e0d\u540c\u7684\u9879\u76ee\uff0c\u800c\u65e0\u9700\u66f4\u6539\u9879\u76ee\u6216\u540e\u53f0\u3002 \u672c\u7bc7\u5173\u4e8e\u300a\u5982\u4f55\u4f7f\u7528 Nginx \u5c06\u591a\u4e2a\u9879\u76ee\u5f52\u7eb3\u5230\u4e00\u4e2a\u5730\u5740\u5e76\u901a\u8fc7 URL \u540e\u7f00\u8fdb\u884c\u5207\u6362\uff1f\u300b\u7684\u4ecb\u7ecd\u5c31\u5230\u6b64\u7ed3\u675f\u5566\uff0c\u4f46\u662f\u5b66\u65e0\u6b62\u5883\uff0c\u60f3\u8981\u4e86\u89e3\u5b66\u4e60\u66f4\u591a\u5173\u4e8e\u6587\u7ae0\u7684\u76f8\u5173\u77e5\u8bc6\uff0c\u8bf7\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\uff01 PHP foreach\u5faa\u73af\u4e2d\uff0c\u5982\u4f55\u83b7\u53d6\u5f39\u6846\u5185\u6570\u636e\u7684ID\u503c\u5e76\u4f20\u9012\u5230\u5176\u4ed6\u9875\u9762\uff1f<\/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-53666","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/53666","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=53666"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/53666\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=53666"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=53666"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=53666"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}