{"id":10988,"date":"2025-04-18T18:23:20","date_gmt":"2025-04-18T10:23:20","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/10988.html"},"modified":"2025-04-18T18:23:20","modified_gmt":"2025-04-18T10:23:20","slug":"windows-%e6%9c%8d%e5%8a%a1%e5%99%a8nginx-%e4%b8%8b%e8%bd%bd%e3%80%81%e9%83%a8%e7%bd%b2%e3%80%81%e9%85%8d%e7%bd%ae%e6%b5%81%e7%a8%8b%ef%bc%88%e5%9b%be%e6%96%87%e6%95%99%e7%a8%8b%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/10988.html","title":{"rendered":"Windows \u670d\u52a1\u5668Nginx \u4e0b\u8f7d\u3001\u90e8\u7f72\u3001\u914d\u7f6e\u6d41\u7a0b\uff08\u56fe\u6587\u6559\u7a0b\uff09"},"content":{"rendered":"<p>\u4e0d\u5b9a\u671f\u66f4\u65b0<\/p>\n<p>\u76ee\u5f55<\/p>\n<p style=\"margin-left:0px\">\u4e00\u3001\u4e0b\u8f7dNginx\u5b89\u88c5\u5305<\/p>\n<p style=\"margin-left:0px\">\u4e8c\u3001\u4e0a\u4f20\u5b89\u88c5\u5305<\/p>\n<p style=\"margin-left:0px\">\u4e09\u3001\u542f\u52a8Nginx<\/p>\n<p style=\"margin-left:0px\">\u56db\u3001Nginx\u5e38\u7528\u547d\u4ee4<\/p>\n<p style=\"margin-left:0px\">\u4e94\u3001Nginx&#xff08;\u6700\u5c0f&#xff09;\u914d\u7f6e\u8be6\u89e3<\/p>\n<p style=\"margin-left:0px\">\u00a0\u516d\u3001Nginx&#xff08;\u57fa\u7840&#xff09;\u914d\u7f6e\u8be6\u89e3<\/p>\n<p style=\"margin-left:0px\">\u4e03\u3001\u53cd\u5411\u4ee3\u7406<\/p>\n<p style=\"margin-left:0px\">\u516b\u3001\u8d1f\u8f7d\u5747\u8861<\/p>\n<p style=\"margin-left:0px\">\u4e5d\u3001\u52a8\u9759\u5206\u79bb<\/p>\n<p style=\"margin-left:0px\">\u5341\u3001\u62a5\u9519<\/p>\n<hr \/>\n<p>\u00a0<\/p>\n<h2>\u4e00\u3001\u4e0b\u8f7dNginx\u5b89\u88c5\u5305<\/h2>\n<p>\u56db\u4e2a\u7f51\u5740&#xff0c;\u6839\u636e\u81ea\u5df1\u7684\u60c5\u51b5\u9009\u62e9&#xff0c;\u6211\u662f\u7528Nginx\u5f00\u6e90\u7248\u7684\u3002<\/p>\n<h3>1\u3001\u4e0b\u8f7d\u7f51\u5740<\/h3>\n<h4>1&#xff09;Nginx\u5f00\u6e90\u7248<\/h4>\n<p><span class=\"link-card-box\"><span class=\"link-title\">nginx news<\/span><span class=\"link-link\"><img decoding=\"async\" alt=\"\" class=\"link-link-icon\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102308-6802280c0881d.png\" \/>http:\/\/nginx.org\/<\/span><\/span><\/p>\n<h4>2&#xff09;Openresty<\/h4>\n<p><span class=\"link-card-box\"><span class=\"link-title\">OpenResty\u00ae &#8211; \u5f00\u6e90\u5b98\u65b9\u7ad9<\/span><span class=\"link-link\"><img decoding=\"async\" alt=\"\" class=\"link-link-icon\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102308-6802280c0881d.png\" \/>https:\/\/openresty.org\/cn\/<\/span><\/span><\/p>\n<h4>3&#xff09;Tengine<\/h4>\n<p><span class=\"link-card-box\"><span class=\"link-title\">Tengine Web \u670d\u52a1\u5668 (taobao.org)<\/span><span class=\"link-link\"><img decoding=\"async\" alt=\"\" class=\"link-link-icon\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102308-6802280c0881d.png\" \/>https:\/\/tengine.taobao.org\/<\/span><\/span><\/p>\n<h4>4&#xff09;Nginx plus \u5546\u4e1a\u7248&#xff08;\u6536\u8d39&#xff09;<\/h4>\n<p><span class=\"link-card-box\"><span class=\"link-title\">F5 | \u591a\u4e91\u5b89\u5168\u548c\u5e94\u7528\u4ea4\u4ed8<\/span><span class=\"link-link\"><img decoding=\"async\" alt=\"\" class=\"link-link-icon\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102308-6802280c0881d.png\" \/>https:\/\/www.f5.com.cn\/<\/span><\/span><\/p>\n<h3>2\u3001\u4e0b\u8f7d<\/h3>\n<p>\u5728Nginx\u5f00\u6e90\u7248\u9009\u62e9\u5bf9\u5e94\u7cfb\u7edf\u4e0b\u8f7dnginx\u5b89\u88c5\u5305<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102308-6802280c10752.png\" alt=\"20fbb724ad794a769dbb9d9497db6e49.png\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102308-6802280c96e8a.png\" alt=\"e5d7d92c0ed44fdfafddd4974071b387.png\" \/><\/p>\n<h2>\u4e8c\u3001\u4e0a\u4f20\u5b89\u88c5\u5305<\/h2>\n<p>\u5c06\u4e0b\u8f7d\u7684Nginx\u5b89\u88c5\u5305\u4e0a\u4f20\u5230Windows\u865a\u62df\u673a\u4e2d\u5e76\u89e3\u538b\u5230\u60f3\u5b89\u88c5\u7684\u8def\u5f84&#xff0c;\u6211\u5c31\u76f4\u63a5\u5728\u684c\u9762\u64cd\u4f5c\u4e86<\/p>\n<p>  \u5982\u679c\u6ca1\u6709Windows Server \u865a\u62df\u673a\u7684&#xff0c;\u53ef\u4ee5\u770b\u4e00\u4e0b\u8fd9\u4e00\u7bc7\u5b89\u88c5\u4e00\u4e2a\u3002 <\/p>\n<p> <span class=\"link-card-box\"><span class=\"link-title\">VMware Windows Server \u865a\u62df\u673a\u5b89\u88c5 \u8be6\u7ec6\u6559\u7a0b_vmware\u5b89\u88c5windows server-CSDN\u535a\u5ba2<\/span><span class=\"link-link\"><img decoding=\"async\" alt=\"\" class=\"link-link-icon\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102308-6802280c0881d.png\" \/>https:\/\/blog.csdn.net\/weixin_68547003\/article\/details\/135177616<\/span><\/span> <\/p>\n<p> \u5e38\u7528\u76ee\u5f55\u7ed3\u6784 <\/p>\n<p>  \u00a0 <\/p>\n<p> 1\u3001<br \/>\n conf <\/p>\n<p>   \u5b58\u653e\u76f8\u5173\u914d\u7f6e\u6587\u4ef6 <\/p>\n<p>  2\u3001html  <\/p>\n<p>   \u5b58\u653e\u9759\u6001\u6587\u4ef6\u7684\u9ed8\u8ba4\u76ee\u5f55 html\u3001css\u7b49 <\/p>\n<p> 3\u3001logs  <\/p>\n<p>  \u5b58\u653eNginx\u76f8\u5173\u65e5\u5fd7 <\/p>\n<p>  \u00a0 <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102309-6802280d29829.png\" alt=\"9e898ede4447453aa42a8b5c636a1466.png\" \/><\/p>\n<h2>\u4e09\u3001\u542f\u52a8Nginx<\/h2>\n<h3>1\u3001\u53cc\u51fbnginx.exe\u542f\u52a8<\/h3>\n<p>\u53cc\u51fb\u540e\u7a97\u53e3\u4f1a\u4e00\u95ea\u800c\u8fc7\u3002<img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102309-6802280dee7d6.png\" alt=\"b41c394d120b4d8fa2f8979e86dae4e5.png\" \/><\/p>\n<h3>2\u3001\u67e5\u770b\u662f\u5426\u542f\u52a8\u6210\u529f<\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102310-6802280e96aba.png\" alt=\"77712dbe4ba6434f8d41735b4a82bde1.png\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102311-6802280f39e50.png\" alt=\"13ec53cbdf424891a39c64d0624087b3.png\" \/><\/p>\n<h3>3\u3001\u8bbf\u95ee\u9ed8\u8ba4\u9875\u9762\u786e\u8ba4<\/h3>\n<p>\u5148\u67e5\u770b\u670d\u52a1\u5668ip<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102311-6802280fd3e73.png\" alt=\"dac4036241ea416b81c534a1ede0c734.png\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102312-6802281080c66.png\" alt=\"5034d3fc285440efb4adea1e1f5df8a3.png\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102313-6802281126187.png\" alt=\"2613001b9222465b90b7a1bb9e583661.png\" \/><\/p>\n<p>\u6253\u5f00\u670d\u52a1\u5668\u6d4f\u89c8\u5668\u8bbf\u95eeip\u5730\u5740&#xff0c;\u9ed8\u8ba4\u7aef\u53e3\u662f80&#xff0c;\u53ef\u4ee5\u4e0d\u7528\u5199\u3002\u76f4\u8bbf\u95eeip&#xff0c;\u51fa\u73b0\u4e0b\u56fe\u754c\u9762&#xff0c;\u5219\u8868\u793a\u5df2\u7ecf\u6210\u529f\u542f\u52a8\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102313-68022811bfe71.png\" alt=\"ccbd552ac4c94bf48433f43c20726253.png\" \/><\/p>\n<h3>4\u3001\u9632\u706b\u5899\u914d\u7f6e<\/h3>\n<p>\u5728\u81ea\u5df1\u7535\u8111\u8bbf\u95ee&#xff0c;\u8981\u4e48\u5173\u95ed\u9632\u706b\u5899&#xff0c;\u8981\u4e48\u5f00\u901a80\u7aef\u53e3\u8bbf\u95ee\u6743\u9650&#xff0c;\u4e0b\u9762\u662f\u5141\u8bb8\u901a\u8fc780\u7aef\u53e3\u6743\u9650\u6dfb\u52a0\u64cd\u4f5c\u6d41\u7a0b&#xff0c;\u540e\u9762\u589e\u52a0\u7aef\u53e3\u4e5f\u662f\u8fd9\u4e48\u914d\u7f6e\u7684\u76f8\u5bf9\u5e94\u7684\u7b56\u7565\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102314-6802281254cec.png\" alt=\"baf0527c11574fb18045a4e18268c4ab.png\" \/><\/p>\n<p>\u4e5f\u53ef\u4ee5\u901a\u8fc7\u63a7\u5236\u9762\u677f\u2192\u7cfb\u7edf\u548c\u5b89\u5168\u2192Windows\u9632\u706b\u5899\u2192\u9ad8\u7ea7\u8bbe\u7f6e\u6d41\u7a0b\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102314-68022812e4297.png\" alt=\"4c2ee324898c4c74ae9f660608d2ef48.png\" \/><\/p>\n<p>\u6dfb\u52a0\u5165\u7ad9\u89c4\u5219<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102315-680228137e814.png\" alt=\"86b0f254c57e44c0a3096301d152af1e.png\" \/><\/p>\n<p>\u5141\u8bb8\u901a\u8fc780\u7aef\u53e3\u8bbf\u95ee<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102316-680228141ad48.png\" alt=\"cf6db22b5d494f889b773be2e6602cec.png\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102316-68022814aa6a7.png\" alt=\"ea6db3072fc0464fa20073b602e2e17d.png\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102317-6802281546af9.png\" alt=\"1e8d125e7d4b4346b8ec354ab0317181.png\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102317-68022815d62ba.png\" alt=\"4c520c9c97e84875acbc5be1aa635e1f.png\" \/><\/p>\n<p>\u6dfb\u52a0\u5b8c\u6210\u540e&#xff0c;\u5728\u81ea\u5df1\u7535\u8111\u8bbf\u95ee\u670d\u52a1\u5668ip&#xff0c;\u51fa\u73b0\u4e0b\u56fe\u754c\u9762\u8868\u793a\u6210\u529f\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102318-6802281670e47.png\" alt=\"d0877758c6c34dfba515bee88fc3a59a.png\" \/><\/p>\n<p>\u00a0<\/p>\n<h2>\u56db\u3001Nginx\u5e38\u7528\u547d\u4ee4<\/h2>\n<table align=\"left\" border=\"1\" cellpadding=\"1\" cellspacing=\"1\" style=\"width:500px\">\n   Nginx\u5e38\u7528\u547d\u4ee4 <\/p>\n<tbody>\n<tr>\n<td>\u547d\u4ee4<\/td>\n<td>\u8bf4\u660e<\/td>\n<\/tr>\n<tr>\n<td>start nginx\u00a0<\/td>\n<td>\u542f\u52a8nginx<\/td>\n<\/tr>\n<tr>\n<td>nginx -s stop<\/td>\n<td>\u505c\u7528Nginx<\/td>\n<\/tr>\n<tr>\n<td>nginx -s quit\u00a0<\/td>\n<td>\u505c\u7528Nginx&#xff08;\u5904\u7406\u5b8c\u6b63\u5728\u8fdb\u884c\u4e2d\u8bf7\u6c42\u540e\u505c\u7528&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>nginx -t<\/td>\n<td>\u9a8c\u8bc1\u65b0\u7684\u914d\u7f6e\u662f\u5426\u6b63\u786e<\/td>\n<\/tr>\n<tr>\n<td>nginx -s reload<\/td>\n<td>\u91cd\u65b0\u52a0\u8f7d\u914d\u7f6e&#xff0c;\u5e76\u91cd\u542f\u8fdb\u7a0b<\/td>\n<\/tr>\n<tr>\n<td>nginx -s reopen<\/td>\n<td>\u91cd\u542f\u65e5\u5fd7\u6587\u4ef6<\/td>\n<\/tr>\n<tr>\n<td>nginx -h<\/td>\n<td>\u67e5\u770b\u5e2e\u52a9\u4fe1\u606f<\/td>\n<\/tr>\n<tr>\n<td>nginx -v<\/td>\n<td>\u67e5\u770bNginx\u7248\u672c<\/td>\n<\/tr>\n<tr>\n<td>taskkill \/f \/t \/im nginx.exe<\/td>\n<td>\u5f7b\u5e95\u5173\u95ednginx&#xff08;\u5173\u95ednginx\u5176\u4ed6\u670d\u52a1&#xff0c;\u8fd9\u6837\u624d\u80fd\u5f7b\u5e95\u5173\u95ed&#xff09;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u00a0<\/p>\n<p>\u00a0<\/p>\n<p>\u00a0<\/p>\n<p>\u00a0<\/p>\n<p>\u00a0<\/p>\n<p>\u00a0<\/p>\n<p>\u00a0<\/p>\n<p>\u00a0<\/p>\n<p>\u00a0<\/p>\n<p>\u00a0<\/p>\n<p>\u00a0<\/p>\n<p>\u00a0<\/p>\n<p>\u6f14\u793a&#xff1a;<\/p>\n<p>\u5728nginx\u6587\u4ef6\u5939\u4e0a\u7684\u8def\u5f84\u76f4\u63a5\u8f93\u5165cmd\u7136\u540e\u56de\u8f66&#xff0c;\u6253\u5f00\u547d\u4ee4\u7a97\u53e3&#xff0c;\u6216\u8005\u901a\u8fc7\u5176\u4ed6\u65b9\u6cd5\u6253\u5f00\u547d\u4ee4\u7a97\u53e3&#xff0c;\u7136\u540e\u5230nginx\u6587\u4ef6\u5939\u8def\u5f84\u4e0b<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102319-6802281718091.png\" alt=\"3efad193846f4f27bff76d2c4f076ca0.png\" \/> \u00a0 \u00a0<img decoding=\"async\" src=\"2025-04-180i0n3vywrd3.png\" alt=\"ee61711fa8404005b9f36fe4007aa5b1.png\" \/><\/p>\n<p>\u547d\u4ee4\u542f\u52a8\u5e76\u67e5\u770b\u7248\u672c\u4fe1\u606f<\/p>\n<p><img decoding=\"async\" src=\"2025-04-1802jwqbqdma5.png\" alt=\"6f74de3d40ce488781357765605a5cee.png\" \/><\/p>\n<p>\u00a0<\/p>\n<h2>\u4e94\u3001Nginx&#xff08;\u6700\u5c0f&#xff09;\u914d\u7f6e\u8be6\u89e3<\/h2>\n<p>  Nginx\u914d\u7f6e\u6587\u4ef6\u662fnginx\u6587\u4ef6\u5939\u8def\u5f84\u4e0b\u7684<br \/>\n conf\u4e2d\u7684<br \/>\n nginx.conf <\/p>\n<p>   \u53ef\u4ee5\u5148\u5c06\u8be5\u914d\u7f6e\u6587\u4ef6\u590d\u5236\u5907\u4efd&#xff0c;\u9632\u6b62\u540e\u9762\u5199\u9519\u4e86&#xff0c;\u8fd8\u80fd\u5bf9\u7167\u683c\u5f0f\u4fee\u6539\u56de\u6765\u3002 <\/p>\n<p>   \u00a0 <\/p>\n<p><img decoding=\"async\" src=\"2025-04-18t4rmuyoutw1.png\" alt=\"c60ff12e3bde47fa833aca5c2fab0f23.png\" \/><\/p>\n<p>\u8fd9\u662f\u4e00\u4e2anginx\u6700\u5e38\u89c4\u7684\u914d\u7f6e\u4ee3\u7801&#xff0c;\u66ff\u6362\u6389\u539fnginx.conf\u7684\u4ee3\u7801&#xff0c;\u91cd\u542fnginx\u6216\u91cd\u65b0nginx\u52a0\u8f7d\u914d\u7f6e&#xff0c;\u53bb\u6d4f\u89c8\u5668\u8bbf\u95ee&#xff0c;\u4e5f\u80fd\u8bbf\u95ee\u5230\u9ed8\u8ba4\u9875\u9762\u3002<\/p>\n<p>#\u9ed8\u8ba4\u4e3a1&#xff0c;\u8868\u793a\u5f00\u542f\u4e00\u4e2a\u4e1a\u52a1\u8fdb\u7a0b\u3002\u6839\u636e\u670d\u52a1\u5668\u6838\u6570\u6765\u914d\u7f6e&#xff0c;\u4e00\u822c1\u4e2a\u6838\u5bf9\u5e941\u4e2a\u8fdb\u7a0b<br \/>\nworker_processes  1;<\/p>\n<p>#error_log  logs\/error.log;<br \/>\n#error_log  logs\/error.log  notice;<br \/>\n#error_log  logs\/error.log  info;<\/p>\n<p>events {<br \/>\n#\u5355\u4e2a\u4e1a\u52a1\u8fdb\u7a0b\u53ef\u63a5\u53d7\u8fde\u63a5\u6570<br \/>\n    worker_connections  1024;<br \/>\n}<\/p>\n<p>http {<br \/>\n#\u5f15\u5165http mime\u7c7b\u578b&#xff0c;\u5f15\u5165\u5728conf\u6587\u4ef6\u4e0b\u7684mime.types\u6587\u4ef6,\u8ba9\u6d4f\u89c8\u5668\u77e5\u9053\u8bc6\u522b\u6587\u4ef6\u540e\u7f00\u540d\u540e\u8be5\u5982\u4f55\u5c55\u793a<br \/>\n    include       mime.types;<br \/>\n#\u5982\u679cmime\u7c7b\u578b\u6ca1\u5339\u914d\u4e0a&#xff0c;\u9ed8\u8ba4\u4f7f\u7528\u4e8c\u8fdb\u5236\u6d41\u7684\u65b9\u5f0f\u4f20\u8f93\u3002<br \/>\n    default_type  application\/octet-stream;<\/p>\n<p>#\u4f7f\u7528\u9ad8\u6548\u7f51\u7edc\u4f20\u8f93&#xff0c;\u4e5f\u5c31\u662f\u6570\u636e0\u62f7\u8d1d&#xff0c;\u76f4\u63a5\u4f20\u8f93\u6570\u636e\u3002\u672a\u5f00\u542fsendfile<br \/>\n    sendfile        on;<br \/>\n    #\u4fdd\u6301\u94fe\u63a5\u65f6\u95f4<br \/>\n    keepalive_timeout  65;<br \/>\n    #vhost\u865a\u62df\u4e3b\u673a<br \/>\n    server {<br \/>\n        #\u76d1\u542c\u7aef\u53e3\u53f7<br \/>\n        listen       80;<br \/>\n        #\u4e3b\u673a\u540d\\\\\u57df\u540d<br \/>\n        server_name  localhost;<br \/>\n        #\u5339\u914d\u8def\u5f84url,\u6837\u4f8b:http:\/\/nginx.org\/en\/download.html<br \/>\n        location \/ {<br \/>\n            #\u6587\u4ef6\u6839\u76ee\u5f55&#xff0c;\u76f8\u5bf9\u4e8enginx\u5b89\u88c5\u6839\u76ee\u5f55\u8def\u5f84<br \/>\n            root   html;<br \/>\n            #\u9ed8\u8ba4\u9875\u540d\u79f0&#xff0c;\u8bbf\u95ee\u5148\u5230\u8bbf\u9875\u9762<br \/>\n            index  index.html index.htm;<br \/>\n        }<br \/>\n        #\u670d\u52a1\u7aef\u62a5\u9519\u540e\u62a5\u9519\u7f16\u7801\u5bf9\u5e94\u9875\u9762\u3002\u6837\u4f8b:http:\/\/nginx.org\/50x.html<br \/>\n        error_page   500 502 503 504  \/50x.html;<br \/>\n        #\u62a5\u9519\u540e\u8bc6\u522b\u5230\u57df\u540d\u540e\u9762\u8ddf\u4e86\/50x.html&#xff0c;\u5219\u5339\u914d\u5230\u6839\u76ee\u5f55root\u4e0b\u7684html\u6587\u4ef6\u5939<br \/>\n        location &#061; \/50x.html {<br \/>\n            root   html;<br \/>\n        }<\/p>\n<p>    }<\/p>\n<p>}<\/p>\n<p>\u66ff\u6362\u6d4b\u8bd5<\/p>\n<p>#\u91cd\u65b0\u52a0\u8f7d\u914d\u7f6e\u547d\u4ee4<br \/>\nnginx -s reload <\/p>\n<p><img decoding=\"async\" src=\"2025-04-18o0hdabryurb.png\" alt=\"6c7191d7b80e4e41b5283521ab5b85a4.png\" \/><\/p>\n<p>\u8bbf\u95eeIP\u5730\u5740&#xff0c;\u4e5f\u80fd\u6210\u529f\u8bbf\u95ee \u00a0 \u00a0<img decoding=\"async\" src=\"2025-04-18m0ag13ly4ko.png\" alt=\"33ee65183c974850938b00aa7c98cdce.png\" \/><\/p>\n<p>\u00a0<\/p>\n<p>\u00a0<\/p>\n<h2>\u00a0\u516d\u3001Nginx&#xff08;\u57fa\u7840&#xff09;\u914d\u7f6e\u8be6\u89e3<\/h2>\n<h3>1\u3001\u57df\u540d\u89e3\u6790<\/h3>\n<p>\u57df\u540d\u89e3\u6790\u662f\u4e3a\u4e86\u540e\u9762 &#xff0c;\u8fdb\u884c\u57df\u540d\u914d\u7f6e\u65f6 &#xff0c;\u8fdb\u884c\u7ec3\u4e60\u3002<\/p>\n<h4>1&#xff09;\u8d2d\u4e70\u57df\u540d\u89e3\u6790&#xff08;\u8981\u82b1\u70b9\u94b1&#xff09;<\/h4>\n<p>\u5efa\u8bae\u7528\u8fd9\u4e2a&#xff0c;\u53ef\u4ee5\u719f\u6089\u4e00\u4e0b&#xff0c;\u540e\u9762\u81ea\u5df1\u6709\u670d\u52a1\u5668\u4e86&#xff0c;\u4e5f\u8fd8\u53ef\u4ee5\u7528&#xff0c;\u4e0d\u60f3\u82b1\u94b1\u7684&#xff0c;\u53ef\u4ee5\u9009\u4e0b\u9762\u7b2c2\u4e2a<\/p>\n<p><span class=\"link-card-box\"><span class=\"link-title\">\u57df\u540d\u6ce8\u518c_\u57df\u540d\u67e5\u8be2_\u57df\u540d\u7533\u8bf7_\u57df\u540d\u8d2d\u4e70_\u57df\u540d\u7eed\u8d39_\u56fd\u9645\u57df\u540d-\u4e07\u7f51-\u963f\u91cc\u4e91\u54c1\u724c (aliyun.com)<\/span><span class=\"link-link\"><img decoding=\"async\" alt=\"\" class=\"link-link-icon\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102308-6802280c0881d.png\" \/>https:\/\/wanwang.aliyun.com\/domain\/?spm&#061;5176.100251.111252.18.1cb84f15FEfsCm<\/span><\/span>\u5728\u963f\u91cc\u4e91\u5b98\u7f51\u8d2d\u4e70\u4e00\u4e2a\u57df\u540d\u6ce8\u518c&#xff08;\u8d2d\u4e70\u8981\u5b9e\u540d\u8ba4\u8bc1\u7684&#xff09;<\/p>\n<p><img decoding=\"async\" src=\"2025-04-18ce55fiyatbd.png\" alt=\"a976b070079d4c7eacb49727bfd108fe.png\" \/><\/p>\n<p>\u9009\u4e00\u4e2a\u4fbf\u5b9c\u7684\u8d2d\u4e70\u5c31\u884c&#xff0c;\u8d2d\u4e70\u540e\u4e00\u5e74\u6709\u6548\u671f\u3002<\/p>\n<p><img decoding=\"async\" src=\"2025-04-18rnk5ivegiwx.png\" alt=\"2b067409a74f4c2dad7158b402da7981.png\" \/>\u8d2d\u4e70\u540e\u5230\u57df\u540d\u63a7\u5236\u53f0\u914d\u7f6e<\/p>\n<p><img decoding=\"async\" src=\"2025-04-18rk5swzsfvi2.png\" alt=\"c0d3127d17374b3292ea2ffe713a1586.png\" \/><\/p>\n<p><img decoding=\"async\" src=\"2025-04-18pnr1shmtx0g.png\" alt=\"5d1e83a5f07d483681e20d181ecfbe50.png\" \/><\/p>\n<p><img decoding=\"async\" src=\"2025-04-18vtnfg2wpfpo.png\" alt=\"b5abd652dff34785a4f2dcb861440681.png\" \/><\/p>\n<p>\u00a0<\/p>\n<p><img decoding=\"async\" src=\"2025-04-18iz34j4bwgnw.png\" alt=\"050d0b6ceedd4eca91d7af64b0b047c3.png\" \/><\/p>\n<p>\u00a0<\/p>\n<p>\u6d4b\u8bd5\u662f\u5426\u6210\u529f&#xff0c;ping\u4e00\u4e0b\u57df\u540d\u3002\u56e0\u4e3a\u662f\u865a\u62df\u673a&#xff0c;\u53ea\u6709\u5728\u81ea\u5df1\u7535\u8111\u4e0a\u624d\u80fdping\u5230&#xff0c;\u60f3\u5728\u4e92\u8054\u4e0a\u8bbf\u95ee&#xff0c;\u5c31\u8981\u8d2d\u4e70\u4e00\u4e2a\u670d\u52a1\u5668&#xff0c;\u7528\u670d\u52a1\u5668ip\u505a\u57df\u540d\u89e3\u6790\u3002<\/p>\n<p>\u5982\u679cping\u4e0d\u5230&#xff0c;\u53ef\u80fd\u662f\u9632\u706b\u5899\u62e6\u622a\u4e86&#xff0c;\u8bb0\u5f97\u5173\u4e00\u4e0b\u9632\u706b\u5899<\/p>\n<p><img decoding=\"async\" src=\"2025-04-18a11ekaqiedo.png\" alt=\"650da47598ab46498d37871e2bb68af3.png\" \/><\/p>\n<p>\u89e3\u6790\u540e\u4e5f\u80fd\u76f4\u63a5\u901a\u8fc7\u57df\u540d\u8bbf\u95ee\u7f51\u9875\u4e86\u3002\u5982\u679c\u7aef\u53e3\u4e0d\u662f80&#xff0c;\u8981\u5728\u57df\u540d\u540e\u52a0\u4e0a\u7aef\u53e3\u53f7<\/p>\n<p><img decoding=\"async\" src=\"2025-04-18kr3mp151zk0.png\" alt=\"3a2d4d58b83e4a77838fd066e8b9d21b.png\" \/><\/p>\n<h4>2&#xff09;\u81ea\u5df1\u7535\u8111\u914d\u7f6ehosts\u89e3\u6790&#xff08;\u514d\u8d39&#xff09;<\/h4>\n<p>\u56e0\u4e3a\u662f\u865a\u62df\u673a&#xff0c;\u6240\u4ee5\u89e3\u6790\u540e\u53ea\u80fd\u5728\u81ea\u5df1\u7535\u8111\u4e0a\u8bbf\u95ee\u3002<\/p>\n<p>\u5728\u81ea\u5df1\u7535\u8111c\u76d8\u4e0a\u641c\u7d22hosts&#xff0c;\u627e\u5230\u5e76\u5230\u8be5\u8def\u5f84\u4e0b\u3002<\/p>\n<p>#\u4e00\u822c\u90fd\u5728\u8fd9\u8def\u5f84\u4e0b<br \/>\nC:\\\\Windows\\\\System32\\\\drivers\\\\etc <\/p>\n<p><img decoding=\"async\" src=\"2025-04-18qme2s5ids5m.png\" alt=\"b0cb42a2a19446449998b16ee5b3284b.png\" \/><\/p>\n<p><img decoding=\"async\" src=\"2025-04-18g55jfjr4akr.png\" alt=\"73ad69de9e214ec99ed7c289ab2fef1f.png\" \/><\/p>\n<p>\u5728\u684c\u9762\u7f16\u8f91\u4fdd\u5b58\u540e&#xff0c;\u5e76\u590d\u5236\u7c98\u8d34\u66ff\u6362\u5230\u539f\u8def\u5f84\u4e0a\u7684\u6587\u4ef6\u3002\u8fd9\u4e2a\u53ea\u80fd\u5339\u914d\u5bf9\u5e94\u7684\u524d\u7f00&#043;\u57df\u540d&#xff0c;\u7ec3\u4e60\u5b8c\u540e\u53ef\u628a\u8be5\u6587\u4ef6\u52a0\u7684\u89e3\u6790\u5220\u4e86\u3002<\/p>\n<p><img decoding=\"async\" src=\"2025-04-18uucyp0yjry0.png\" alt=\"0c33ddb7089c4801b489572fe5b286bb.png\" \/><\/p>\n<p><img decoding=\"async\" src=\"2025-04-18naewic5m3wo.png\" alt=\"5fc1cd9ff25a4021b29f5b8e0587c5c6.png\" \/><\/p>\n<p>\u6253\u5f00\u547d\u4ee4\u7a97\u53e3&#xff0c;ping\u4e00\u4e0b,\u770b\u80fd\u4e0d\u80fd\u901a\u3002<\/p>\n<p>\u00a0<\/p>\n<h3>2\u3001\u540c\u4e00IP\u7528\u4e0d\u540c\u7aef\u53e3\u8bbf\u95ee\u4e0d\u540c\u9875\u9762<\/h3>\n<h4>1&#xff09;\u684c\u9762\u65b0\u5efa\u4e24\u4e2a\u6587\u4ef6\u5939<\/h4>\n<p>\u8fd9\u4e24\u4e2a\u6587\u4ef6\u7528\u6765\u653e\u4e24\u4e2a\u4e0d\u540chtml\u9875\u9762<\/p>\n<p><img decoding=\"async\" src=\"2025-04-185woh0ifip1v.png\" alt=\"c79eb7e1051848398b3fe537003cb6b1.png\" \/><\/p>\n<h4>2&#xff09;\u521b\u5efahtml\u6587\u4ef6<\/h4>\n<p>\u5728\u65b0\u7684\u4e24\u4e2a\u6587\u4ef6\u5939\u4e2d&#xff0c;\u90fd\u65b0\u5efa\u4e00\u4e2a\u6587\u672c\u6587\u6863&#xff0c;\u7136\u540e\u5c06\u540d\u79f0\u548c\u540e\u7f00\u6539\u6210index.html&#xff0c;\u53f3\u952e\u7f16\u8f91&#xff0c;\u968f\u4fbf\u5728\u91cc\u9762\u5199\u70b9\u4ec0\u4e48&#xff0c;\u80fd\u533a\u5206\u4e24\u4e2a\u9875\u9762\u5c31\u884c<\/p>\n<p>#www<br \/>\nHello Wlorld!1-1<\/p>\n<p>#web<br \/>\nHello Wlorld!2-2 <\/p>\n<p><img decoding=\"async\" src=\"2025-04-18byzgd0qbt1r.png\" alt=\"9e1a76a7bebd467e8fc777891ac6ccdd.png\" \/><\/p>\n<p><img decoding=\"async\" src=\"2025-04-18ldnnwtvlfnr.png\" alt=\"613b4bb9b3ad4845a89a3a4c9c7863c2.png\" \/><\/p>\n<h4>3&#xff09;nginx.conf\u4ee3\u7801<\/h4>\n<p>\u81ea\u884c\u8ddf\u4e0a\u9762\u7684\u5e38\u89c4\u914d\u7f6e\u5bf9\u6bd4&#xff0c;\u4e3b\u8981\u591a\u4e86\u4e00\u4e2a\u865a\u62df\u4e3b\u673aserver\u4ee3\u7801&#xff0c;\u7ed9\u4e86888\u548c899\u7aef\u53e3&#xff0c;\u4fee\u6539\u4e86\u5339\u914d\u5c55\u793a\u9875\u9762\u7684\u8def\u5f84\u3002<\/p>\n<p><img decoding=\"async\" src=\"2025-04-18xdnbdbtjcx5.png\" alt=\"baeeeba9c37146af843f03f7f1f00be5.png\" \/><\/p>\n<p>#\u9ed8\u8ba4\u4e3a1&#xff0c;\u8868\u793a\u5f00\u542f\u4e00\u4e2a\u4e1a\u52a1\u8fdb\u7a0b\u3002\u6839\u636e\u670d\u52a1\u5668\u6838\u6570\u6765\u914d\u7f6e&#xff0c;\u4e00\u822c1\u4e2a\u6838\u5bf9\u5e941\u4e2a\u8fdb\u7a0b<br \/>\nworker_processes  1;<\/p>\n<p>#error_log  logs\/error.log;<br \/>\n#error_log  logs\/error.log  notice;<br \/>\n#error_log  logs\/error.log  info;<\/p>\n<p>events {<br \/>\n#\u5355\u4e2a\u4e1a\u52a1\u8fdb\u7a0b\u53ef\u63a5\u53d7\u8fde\u63a5\u6570<br \/>\n    worker_connections  1024;<br \/>\n}<\/p>\n<p>http {<br \/>\n#\u5f15\u5165http mime\u7c7b\u578b&#xff0c;\u5f15\u5165\u5728conf\u6587\u4ef6\u4e0b\u7684mime.types\u6587\u4ef6,\u8ba9\u6d4f\u89c8\u5668\u77e5\u9053\u8bc6\u522b\u6587\u4ef6\u540e\u7f00\u540d\u540e\u8be5\u5982\u4f55\u5c55\u793a<br \/>\n    include       mime.types;<br \/>\n#\u5982\u679cmime\u7c7b\u578b\u6ca1\u5339\u914d\u4e0a&#xff0c;\u9ed8\u8ba4\u4f7f\u7528\u4e8c\u8fdb\u5236\u6d41\u7684\u65b9\u5f0f\u4f20\u8f93\u3002<br \/>\n    default_type  application\/octet-stream;<\/p>\n<p>#\u4f7f\u7528\u9ad8\u6548\u7f51\u7edc\u4f20\u8f93&#xff0c;\u4e5f\u5c31\u662f\u6570\u636e0\u62f7\u8d1d&#xff0c;\u76f4\u63a5\u4f20\u8f93\u6570\u636e\u3002\u672a\u5f00\u542fsendfile<br \/>\n    sendfile        on;<br \/>\n    #\u4fdd\u6301\u94fe\u63a5\u65f6\u95f4<br \/>\n    keepalive_timeout  65;<\/p>\n<p>    #vhost\u865a\u62df\u4e3b\u673a-1<br \/>\n    server {<br \/>\n        #\u76d1\u542c\u7aef\u53e3\u53f7<br \/>\n        listen       888;<br \/>\n        #\u4e3b\u673a\u540d\\\\\u57df\u540d<br \/>\n        server_name  localhost;<br \/>\n        #\u5339\u914d\u8def\u5f84url,\u6837\u4f8b:http:\/\/nginx.org\/en\/download.html<br \/>\n        location \/ {<br \/>\n            #\u6587\u4ef6\u6839\u76ee\u5f55&#xff0c;\u76f8\u5bf9\u4e8enginx\u5b89\u88c5\u6839\u76ee\u5f55\u8def\u5f84<br \/>\n            root   C:\/Users\/Administrator\/Desktop\/web;<br \/>\n            #\u9ed8\u8ba4\u9875\u540d\u79f0&#xff0c;\u8bbf\u95ee\u5148\u5230\u8bbf\u9875\u9762<br \/>\n            index  index.html index.htm;<br \/>\n        }<br \/>\n        #\u670d\u52a1\u7aef\u62a5\u9519\u540e\u62a5\u9519\u7f16\u7801\u5bf9\u5e94\u9875\u9762\u3002\u6837\u4f8b:http:\/\/nginx.org\/50x.html<br \/>\n        error_page   500 502 503 504  \/50x.html;<br \/>\n        #\u62a5\u9519\u540e\u8bc6\u522b\u5230\u57df\u540d\u540e\u9762\u8ddf\u4e86\/50x.html&#xff0c;\u5219\u5339\u914d\u5230\u6839\u76ee\u5f55root\u4e0b\u7684html\u6587\u4ef6\u5939<br \/>\n        location &#061; \/50x.html {<br \/>\n            root   html;<br \/>\n        }<\/p>\n<p>    }<br \/>\n #vhost\u865a\u62df\u4e3b\u673a-2<br \/>\n    server {<br \/>\n        #\u76d1\u542c\u7aef\u53e3\u53f7<br \/>\n        listen       899;<br \/>\n        #\u4e3b\u673a\u540d\\\\\u57df\u540d<br \/>\n        server_name  localhost;<br \/>\n        #\u5339\u914d\u8def\u5f84url,\u6837\u4f8b:http:\/\/nginx.org\/en\/download.html<br \/>\n        location \/ {<br \/>\n            #\u6587\u4ef6\u6839\u76ee\u5f55&#xff0c;\u76f8\u5bf9\u4e8enginx\u5b89\u88c5\u6839\u76ee\u5f55\u8def\u5f84<br \/>\n            root   C:\/Users\/Administrator\/Desktop\/www;<br \/>\n            #\u9ed8\u8ba4\u9875\u540d\u79f0&#xff0c;\u8bbf\u95ee\u5148\u5230\u8bbf\u9875\u9762<br \/>\n            index  index.html index.htm;<br \/>\n        }<br \/>\n        #\u670d\u52a1\u7aef\u62a5\u9519\u540e\u62a5\u9519\u7f16\u7801\u5bf9\u5e94\u9875\u9762\u3002\u6837\u4f8b:http:\/\/nginx.org\/50x.html<br \/>\n        error_page   500 502 503 504  \/50x.html;<br \/>\n        #\u62a5\u9519\u540e\u8bc6\u522b\u5230\u57df\u540d\u540e\u9762\u8ddf\u4e86\/50x.html&#xff0c;\u5219\u5339\u914d\u5230\u6839\u76ee\u5f55root\u4e0b\u7684html\u6587\u4ef6\u5939<br \/>\n        location &#061; \/50x.html {<br \/>\n            root   html;<br \/>\n        }<\/p>\n<p>    }<\/p>\n<p>}<\/p>\n<h4>4&#xff09;\u91cd\u542f<\/h4>\n<p>\u628a\u4ee3\u7801\u52a0\u8fdb\u914d\u7f6e\u6587\u4ef6\u4e2d&#xff0c;\u5728nginx\u5b89\u88c5\u8def\u5f84\u4e0b\u6267\u884cnginx -t\u00a0\u547d\u4ee4\u6d4b\u8bd5\u914d\u7f6e\u662f\u5426\u751f\u6548&#xff0c;\u3002\u770b\u4e0d\u61c2\u82f1\u6587\u7684&#xff0c;\u7ffb\u8bd1\u8f6f\u4ef6\u7ffb\u8bd1\u4e00\u4e0b&#xff0c;\u63d0\u793a\u6b63\u786e&#xff0c;\u91cd\u65b0\u52a0\u8f7d\u914d\u7f6e\u3002<\/p>\n<p>#\u3002\u6d4b\u8bd5\u914d\u7f6e\u662f\u5426\u6b63\u786e&#xff0c;\u5b9e\u9645\u73af\u5883\u4e2d\u90fd\u4f1a\u5148\u6d4b\u8bd5\u4e00\u4e0b&#xff0c;\u518d\u91cd\u542f\u5f0e\u6216\u91cd\u65b0\u52a0\u8f7d\u914d\u7f6e<br \/>\nnginx -t<br \/>\n#\u91cd\u65b0\u52a0\u8f7d\u914d\u7f6e<br \/>\nnginx -s reload <\/p>\n<p><img decoding=\"async\" src=\"2025-04-18gtcqr41ax2h.png\" alt=\"090094eef58a4def846fccf889b6dbdf.png\" \/><\/p>\n<h4>5&#xff09;\u8bbf\u95ee\u5730\u5740\u6d4b\u8bd5<\/h4>\n<p>IP\u540e\u9762\u52a0\u7aef\u53e3&#xff0c;ip:888&#xff0c;ip:899\u3002<\/p>\n<p>\u6ce8\u610f\u9632\u706b\u5899&#xff0c;\u5f00\u901a\u4e00\u4e0b\u7aef\u53e3&#xff0c;\u8981\u4e48\u76f4\u63a5\u5173\u95ed\u9632\u706b\u5899\u3002\u8fd9\u4e3a\u4e86\u65b9\u4fbf\u5c31\u76f4\u63a5\u5173\u95ed\u9632\u706b\u5899\u4e86\u3002<\/p>\n<p><img decoding=\"async\" src=\"2025-04-18ufg5r2rnaav.png\" alt=\"b7b9eb45682b4c03837cabb3ab59c1c7.png\" \/><\/p>\n<p><img decoding=\"async\" src=\"2025-04-183v3vyploste.png\" alt=\"35c42c9d683449c3804f9b3ee2e956f2.png\" \/><\/p>\n<p>\u00a0<\/p>\n<h3>3\u3001\u540c\u4e00IP\u540c\u4e00\u7aef\u53e3\u7528\u4e0d\u540c\u57df\u540d\u8bbf\u95ee\u4e0d\u540c\u9875\u9762<\/h3>\n<h4>1&#xff09;html\u9875\u9762\u6587\u4ef6\u5939\u8fd8\u662f\u7528\u4e0a\u9762\u90a3\u4e24\u4e2a<\/h4>\n<p>\u00a0<\/p>\n<h4>2&#xff09;nginx.conf\u4ee3\u7801<\/h4>\n<p>\u7aef\u53e3\u53f7\u6539\u56de80&#xff0c;\u66f4\u6539\u57df\u540d&#xff0c;\u6839\u636e\u57df\u540d\u524d\u7f00\u6765\u5339\u914d\u3002<\/p>\n<p>\u4e5f\u53ef\u4e0d\u66f4\u6539\u7aef\u53e3&#xff0c;\u57df\u540d\u540e\u52a0\u4e0a\u7aef\u53e3&#xff0c;\u5373\u53ef\u8bbf\u95ee\u3002<\/p>\n<p><img decoding=\"async\" src=\"2025-04-18s2ekhaae3bd.png\" alt=\"17d8f7ac3496467eb8f1e6e25608f6ac.png\" \/><\/p>\n<p>#\u9ed8\u8ba4\u4e3a1&#xff0c;\u8868\u793a\u5f00\u542f\u4e00\u4e2a\u4e1a\u52a1\u8fdb\u7a0b\u3002\u6839\u636e\u670d\u52a1\u5668\u6838\u6570\u6765\u914d\u7f6e&#xff0c;\u4e00\u822c1\u4e2a\u6838\u5bf9\u5e941\u4e2a\u8fdb\u7a0b<br \/>\nworker_processes  1;<\/p>\n<p>#error_log  logs\/error.log;<br \/>\n#error_log  logs\/error.log  notice;<br \/>\n#error_log  logs\/error.log  info;<\/p>\n<p>events {<br \/>\n#\u5355\u4e2a\u4e1a\u52a1\u8fdb\u7a0b\u53ef\u63a5\u53d7\u8fde\u63a5\u6570<br \/>\n    worker_connections  1024;<br \/>\n}<\/p>\n<p>http {<br \/>\n#\u5f15\u5165http mime\u7c7b\u578b&#xff0c;\u5f15\u5165\u5728conf\u6587\u4ef6\u4e0b\u7684mime.types\u6587\u4ef6,\u8ba9\u6d4f\u89c8\u5668\u77e5\u9053\u8bc6\u522b\u6587\u4ef6\u540e\u7f00\u540d\u540e\u8be5\u5982\u4f55\u5c55\u793a<br \/>\n    include       mime.types;<br \/>\n#\u5982\u679cmime\u7c7b\u578b\u6ca1\u5339\u914d\u4e0a&#xff0c;\u9ed8\u8ba4\u4f7f\u7528\u4e8c\u8fdb\u5236\u6d41\u7684\u65b9\u5f0f\u4f20\u8f93\u3002<br \/>\n    default_type  application\/octet-stream;<\/p>\n<p>#\u4f7f\u7528\u9ad8\u6548\u7f51\u7edc\u4f20\u8f93&#xff0c;\u4e5f\u5c31\u662f\u6570\u636e0\u62f7\u8d1d&#xff0c;\u76f4\u63a5\u4f20\u8f93\u6570\u636e\u3002\u672a\u5f00\u542fsendfile<br \/>\n    sendfile        on;<br \/>\n    #\u4fdd\u6301\u94fe\u63a5\u65f6\u95f4<br \/>\n    keepalive_timeout  65;<\/p>\n<p>    #vhost\u865a\u62df\u4e3b\u673a-1<br \/>\n    server {<br \/>\n        #\u76d1\u542c\u7aef\u53e3\u53f7<br \/>\n        listen       80;<br \/>\n        #\u4e3b\u673a\u540d\\\\\u57df\u540d&#xff0c;\u7a7a\u683c\u540e\u9762\u53ef\u4ee5\u518d\u63a5\u4e00\u4e2a\u57df\u540d&#xff0c;\u652f\u6301\u6b63\u5219&#xff0c;\u4e0d\u540c\u57df\u540d\u540e\u7f00\u4e5f\u53ef\u4ee5\u3002<br \/>\n        server_name  www.lingran.website;<br \/>\n        #\u5339\u914d\u8def\u5f84url,\u6837\u4f8b:http:\/\/nginx.org\/en\/download.html<br \/>\n        location \/ {<br \/>\n            #\u6587\u4ef6\u6839\u76ee\u5f55&#xff0c;\u76f8\u5bf9\u4e8enginx\u5b89\u88c5\u6839\u76ee\u5f55\u8def\u5f84<br \/>\n            root   C:\/Users\/Administrator\/Desktop\/www;<br \/>\n            #\u9ed8\u8ba4\u9875\u540d\u79f0&#xff0c;\u8bbf\u95ee\u5148\u5230\u8bbf\u9875\u9762<br \/>\n            index  index.html index.htm;<br \/>\n        }<br \/>\n        #\u670d\u52a1\u7aef\u62a5\u9519\u540e\u62a5\u9519\u7f16\u7801\u5bf9\u5e94\u9875\u9762\u3002\u6837\u4f8b:http:\/\/nginx.org\/50x.html<br \/>\n        error_page   500 502 503 504  \/50x.html;<br \/>\n        #\u62a5\u9519\u540e\u8bc6\u522b\u5230\u57df\u540d\u540e\u9762\u8ddf\u4e86\/50x.html&#xff0c;\u5219\u5339\u914d\u5230\u6839\u76ee\u5f55root\u4e0b\u7684html\u6587\u4ef6\u5939<br \/>\n        location &#061; \/50x.html {<br \/>\n            root   html;<br \/>\n        }<\/p>\n<p>    }<br \/>\n #vhost\u865a\u62df\u4e3b\u673a-2<br \/>\n    server {<br \/>\n        #\u76d1\u542c\u7aef\u53e3\u53f7<br \/>\n        listen       80;<br \/>\n        #\u4e3b\u673a\u540d\\\\\u57df\u540d&#xff0c;\u7a7a\u683c\u540e\u9762\u53ef\u4ee5\u518d\u63a5\u4e00\u4e2a\u57df\u540d&#xff0c;\u652f\u6301\u6b63\u5219&#xff0c;\u4e0d\u540c\u57df\u540d\u540e\u7f00\u4e5f\u53ef\u4ee5\u3002<br \/>\n        server_name  aaa.lingran.website;<br \/>\n        #\u5339\u914d\u8def\u5f84url,\u6837\u4f8b:http:\/\/nginx.org\/en\/download.html<br \/>\n        location \/ {<br \/>\n            #\u6587\u4ef6\u6839\u76ee\u5f55&#xff0c;\u76f8\u5bf9\u4e8enginx\u5b89\u88c5\u6839\u76ee\u5f55\u8def\u5f84<br \/>\n            root   C:\/Users\/Administrator\/Desktop\/web;<br \/>\n            #\u9ed8\u8ba4\u9875\u540d\u79f0&#xff0c;\u8bbf\u95ee\u5148\u5230\u8bbf\u9875\u9762<br \/>\n            index  index.html index.htm;<br \/>\n        }<br \/>\n        #\u670d\u52a1\u7aef\u62a5\u9519\u540e\u62a5\u9519\u7f16\u7801\u5bf9\u5e94\u9875\u9762\u3002\u6837\u4f8b:http:\/\/nginx.org\/50x.html<br \/>\n        error_page   500 502 503 504  \/50x.html;<br \/>\n        #\u62a5\u9519\u540e\u8bc6\u522b\u5230\u57df\u540d\u540e\u9762\u8ddf\u4e86\/50x.html&#xff0c;\u5219\u5339\u914d\u5230\u6839\u76ee\u5f55root\u4e0b\u7684html\u6587\u4ef6\u5939<br \/>\n        location &#061; \/50x.html {<br \/>\n            root   html;<br \/>\n        }<\/p>\n<p>    }<\/p>\n<p>}<\/p>\n<h4>3&#xff09;\u91cd\u542f<\/h4>\n<p>\u628a\u4ee3\u7801\u52a0\u8fdb\u914d\u7f6e\u6587\u4ef6\u4e2d&#xff0c;\u5728nginx\u5b89\u88c5\u8def\u5f84\u4e0b\u6267\u884cnginx -t\u00a0\u547d\u4ee4\u6d4b\u8bd5\u914d\u7f6e\u662f\u5426\u751f\u6548\u3002\u770b\u4e0d\u61c2\u82f1\u6587\u7684&#xff0c;\u7ffb\u8bd1\u8f6f\u4ef6\u7ffb\u8bd1\u4e00\u4e0b&#xff0c;\u63d0\u793a\u6b63\u786e&#xff0c;\u91cd\u65b0\u52a0\u8f7d\u914d\u7f6e\u3002<\/p>\n<p>#\u3002\u6d4b\u8bd5\u914d\u7f6e\u662f\u5426\u6b63\u786e&#xff0c;\u5b9e\u9645\u73af\u5883\u4e2d\u90fd\u4f1a\u5148\u6d4b\u8bd5\u4e00\u4e0b&#xff0c;\u518d\u91cd\u542f\u5f0e\u6216\u91cd\u65b0\u52a0\u8f7d\u914d\u7f6e<br \/>\nnginx -t<br \/>\n#\u91cd\u65b0\u52a0\u8f7d\u914d\u7f6e<br \/>\nnginx -s reload <\/p>\n<p><img decoding=\"async\" src=\"2025-04-18vsc4znl1fe5.png\" alt=\"b43e4ca442564580890e96a24fbf114d.png\" \/><\/p>\n<h4>4&#xff09;\u8bbf\u95ee\u5730\u5740\u6d4b\u8bd5<\/h4>\n<p>\u57df\u540d\u76f4\u63a5\u8bbf\u95ee&#xff0c;\u7aef\u53e3\u5982\u679c\u4e0d\u662f80\u8981\u52a0\u4e0a\u7aef\u53e3\u53f7\u3002<\/p>\n<p>\u56e0\u4e3a\u914d\u7f6e\u57df\u540d\u89e3\u6790\u7684\u65f6\u5019\u662f\u914d\u7f6e\u89e3\u6790\u5168\u90e8\u7684&#xff0c;\u6240\u4ee5\u9664\u4e86\u7b2c\u4e8c\u4e2avhost\u865a\u62df\u4e3b\u673a-2\u7684\u914d\u7f6e\u7684aaa.lingran.website\u57df\u540d\u4f1a\u5230\u7b2c\u4e8c\u4e2a\u9875\u9762&#xff0c;\u5176\u4ed6\u7684\u57df\u540d\u9ed8\u8ba4\u5230\u7b2c\u4e00\u4e2a\u9875\u9762\u5373vhost\u865a\u62df\u4e3b\u673a-1\u7684\u9875\u9762\u3002<\/p>\n<p>\u5982\u679c\u60f3\u5176\u4ed6\u57df\u540d\u9ed8\u8ba4\u5230vhost\u865a\u62df\u4e3b\u673a-2\u7684\u9875\u9762&#xff0c;\u53ef\u5c06\u57df\u540d\u6539\u4e3a\u901a\u914d\u7b26\u00a0*.lingran.website\u00a0&#xff0c;\u3002\u8fd9\u6837\u9664\u4e86www.lingran.website\u4f1a\u5230vhost\u865a\u62df\u4e3b\u673a-1\u7684\u9875\u9762&#xff0c;\u5176\u4ed6\u7684\u90fd\u5230vhost\u865a\u62df\u4e3b\u673a-2\u7684\u9875\u9762\u3002<\/p>\n<p>\u5339\u914d\u4e3a\u987a\u5e8f\u7cbe\u51c6\u5339\u914d\u2192\u57df\u540d\u540e\u7f00\u901a\u914d\u7b26\u5339\u914d\u2192\u57df\u540d\u524d\u7f00\u901a\u914d\u7b26\u5339\u914d\u2192\u6b63\u5219\u5339\u914d&#xff0c;\u5339\u914d\u5230\u5219\u505c\u6b62<\/p>\n<p><img decoding=\"async\" src=\"2025-04-18qb42vrslk4m.png\" alt=\"8a556204b40c421399d8e75872cfbe28.png\" \/><\/p>\n<p><img decoding=\"async\" src=\"2025-04-1802cpeiqgygm.png\" alt=\"ad2488a950494c6aa469d4964da450e1.png\" \/><\/p>\n<p><img decoding=\"async\" src=\"2025-04-18cplu403jcqw.png\" alt=\"7581d52682a84256a8f535ce93819cce.png\" \/><\/p>\n<h2>\u4e03\u3001\u53cd\u5411\u4ee3\u7406<\/h2>\n<h3>1\u3001\u6982\u5ff5<\/h3>\n<p>\u53cd\u5411\u4ee3\u7406\u7684\u4ee3\u7406\u670d\u52a1\u5668\u5728\u670d\u52a1\u7aef&#xff0c;\u8bf7\u6c42\u662f\u88ab\u52a8\u7684\u88ab\u4ee3\u7406\u4e86\u3002\u53cd\u5411\u4ee3\u7406\u5ba2\u6237\u7aef\u770b\u4e0d\u5230\u771f\u6b63\u7684\u4e1a\u52a1\u670d\u52a1\u5668\u3002<\/p>\n<p><img decoding=\"async\" src=\"2025-04-18xmigg30djqo.png\" alt=\"1c9794c5e0884a509a80a5130b750a2c.png\" \/><\/p>\n<p>\u6b63\u5411\u4ee3\u7406\u7684\u4ee3\u7406\u670d\u52a1\u5668\u5728\u5ba2\u6237\u7aef&#xff0c;\u8bf7\u6c42\u662f\u4e3b\u52a8\u8981\u6c42\u88ab\u4ee3\u7406\u7684\u3002\u6b63\u5411\u4ee3\u7406\u670d\u52a1\u5668\u770b\u4e0d\u5230\u771f\u6b63\u7684\u5ba2\u6237\u7aef\u3002<img decoding=\"async\" src=\"2025-04-18ml3eh0evyi1.png\" alt=\"6528ab1395a7482091af04644d7e6c63.png\" \/><\/p>\n<h3>2\u3001\u53cd\u5411\u4ee3\u7406nginx.conf\u4ee3\u7801\u914d\u7f6e<\/h3>\n<p>proxy_pass\u914d\u7f6e&#xff0c;\u4ee3\u7406b\u7ad9\u548c\u767e\u5ea6\u8fd9\u4e24\u4e2a\u7f51\u5740\u3002<\/p>\n<p><img decoding=\"async\" src=\"2025-04-18v3h1hwmcoeu.png\" alt=\"ac1328c4f2f1496a885431cc3afa8cb7.png\" \/><\/p>\n<p>nginx.conf\u4ee3\u7801<\/p>\n<p>#\u9ed8\u8ba4\u4e3a1&#xff0c;\u8868\u793a\u5f00\u542f\u4e00\u4e2a\u4e1a\u52a1\u8fdb\u7a0b\u3002\u6839\u636e\u670d\u52a1\u5668\u6838\u6570\u6765\u914d\u7f6e&#xff0c;\u4e00\u822c1\u4e2a\u6838\u5bf9\u5e941\u4e2a\u8fdb\u7a0b<br \/>\nworker_processes  1;<\/p>\n<p>#error_log  logs\/error.log;<br \/>\n#error_log  logs\/error.log  notice;<br \/>\n#error_log  logs\/error.log  info;<\/p>\n<p>events {<br \/>\n#\u5355\u4e2a\u4e1a\u52a1\u8fdb\u7a0b\u53ef\u63a5\u53d7\u8fde\u63a5\u6570<br \/>\n    worker_connections  1024;<br \/>\n}<\/p>\n<p>http {<br \/>\n#\u5f15\u5165http mime\u7c7b\u578b&#xff0c;\u5f15\u5165\u5728conf\u6587\u4ef6\u4e0b\u7684mime.types\u6587\u4ef6,\u8ba9\u6d4f\u89c8\u5668\u77e5\u9053\u8bc6\u522b\u6587\u4ef6\u540e\u7f00\u540d\u540e\u8be5\u5982\u4f55\u5c55\u793a<br \/>\n    include       mime.types;<br \/>\n#\u5982\u679cmime\u7c7b\u578b\u6ca1\u5339\u914d\u4e0a&#xff0c;\u9ed8\u8ba4\u4f7f\u7528\u4e8c\u8fdb\u5236\u6d41\u7684\u65b9\u5f0f\u4f20\u8f93\u3002<br \/>\n    default_type  application\/octet-stream;<\/p>\n<p>#\u4f7f\u7528\u9ad8\u6548\u7f51\u7edc\u4f20\u8f93&#xff0c;\u4e5f\u5c31\u662f\u6570\u636e0\u62f7\u8d1d&#xff0c;\u76f4\u63a5\u4f20\u8f93\u6570\u636e\u3002\u672a\u5f00\u542fsendfile<br \/>\n    sendfile        on;<br \/>\n    #\u4fdd\u6301\u94fe\u63a5\u65f6\u95f4<br \/>\n    keepalive_timeout  65;<\/p>\n<p>    #vhost\u865a\u62df\u4e3b\u673a-1<br \/>\n    server {<br \/>\n        #\u76d1\u542c\u7aef\u53e3\u53f7<br \/>\n        listen       80;<br \/>\n        #\u4e3b\u673a\u540d\\\\\u57df\u540d&#xff0c;\u7a7a\u683c\u540e\u9762\u53ef\u4ee5\u518d\u63a5\u4e00\u4e2a\u57df\u540d&#xff0c;\u652f\u6301\u6b63\u5219&#xff0c;\u4e0d\u540c\u57df\u540d\u540e\u7f00\u4e5f\u53ef\u4ee5\u3002<br \/>\n        server_name  www.lingran.website;<br \/>\n        #\u5339\u914d\u8def\u5f84url,\u6837\u4f8b:http:\/\/nginx.org\/en\/download.html<br \/>\n        location \/ {<br \/>\n            #proxy_pass\u4ee3\u7406\u5176\u5b83\u57df\u540d\u7f51\u5740&#xff0c;proxy_pass\u548croot\u53ea\u80fd\u4e8c\u9009\u4e00\u3002<br \/>\n            proxy_pass https:\/\/www.bilibili.com;<\/p>\n<p>            #\u6587\u4ef6\u6839\u76ee\u5f55&#xff0c;\u76f8\u5bf9\u4e8enginx\u5b89\u88c5\u6839\u76ee\u5f55\u8def\u5f84<br \/>\n            #root   C:\/Users\/Administrator\/Desktop\/www;<br \/>\n            #\u9ed8\u8ba4\u9875\u540d\u79f0&#xff0c;\u8bbf\u95ee\u5148\u5230\u8bbf\u9875\u9762<br \/>\n            #index  index.html index.htm;<br \/>\n        }<br \/>\n        #\u670d\u52a1\u7aef\u62a5\u9519\u540e\u62a5\u9519\u7f16\u7801\u5bf9\u5e94\u9875\u9762\u3002\u6837\u4f8b:http:\/\/nginx.org\/50x.html<br \/>\n        error_page   500 502 503 504  \/50x.html;<br \/>\n        #\u62a5\u9519\u540e\u8bc6\u522b\u5230\u57df\u540d\u540e\u9762\u8ddf\u4e86\/50x.html&#xff0c;\u5219\u5339\u914d\u5230\u6839\u76ee\u5f55root\u4e0b\u7684html\u6587\u4ef6\u5939<br \/>\n        location &#061; \/50x.html {<br \/>\n            root   html;<br \/>\n        }<\/p>\n<p>    }<br \/>\n #vhost\u865a\u62df\u4e3b\u673a-2<br \/>\n    server {<br \/>\n        #\u76d1\u542c\u7aef\u53e3\u53f7<br \/>\n        listen       80;<br \/>\n        #\u4e3b\u673a\u540d\\\\\u57df\u540d&#xff0c;\u7a7a\u683c\u540e\u9762\u53ef\u4ee5\u518d\u63a5\u4e00\u4e2a\u57df\u540d&#xff0c;\u652f\u6301\u6b63\u5219&#xff0c;\u4e0d\u540c\u57df\u540d\u540e\u7f00\u4e5f\u53ef\u4ee5\u3002<br \/>\n        server_name  aaa.lingran.website;<br \/>\n        #\u5339\u914d\u8def\u5f84url,\u6837\u4f8b:http:\/\/nginx.org\/en\/download.html<br \/>\n        location \/ {<br \/>\n            #proxy_pass\u4ee3\u7406\u5176\u5b83\u57df\u540d\u7f51\u5740&#xff0c;proxy_pass\u548croot\u53ea\u80fd\u4e8c\u9009\u4e00\u3002<br \/>\n            proxy_pass https:\/\/www.baidu.com;<\/p>\n<p>            #\u6587\u4ef6\u6839\u76ee\u5f55&#xff0c;\u76f8\u5bf9\u4e8enginx\u5b89\u88c5\u6839\u76ee\u5f55\u8def\u5f84<br \/>\n            #root   C:\/Users\/Administrator\/Desktop\/www;<br \/>\n            #\u9ed8\u8ba4\u9875\u540d\u79f0&#xff0c;\u8bbf\u95ee\u5148\u5230\u8bbf\u9875\u9762<br \/>\n            #index  index.html index.htm;<br \/>\n        }<br \/>\n        #\u670d\u52a1\u7aef\u62a5\u9519\u540e\u62a5\u9519\u7f16\u7801\u5bf9\u5e94\u9875\u9762\u3002\u6837\u4f8b:http:\/\/nginx.org\/50x.html<br \/>\n        error_page   500 502 503 504  \/50x.html;<br \/>\n        #\u62a5\u9519\u540e\u8bc6\u522b\u5230\u57df\u540d\u540e\u9762\u8ddf\u4e86\/50x.html&#xff0c;\u5219\u5339\u914d\u5230\u6839\u76ee\u5f55root\u4e0b\u7684html\u6587\u4ef6\u5939<br \/>\n        location &#061; \/50x.html {<br \/>\n            root   html;<br \/>\n        }<\/p>\n<p>    }<\/p>\n<p>}<\/p>\n<h3>3\u3001\u91cd\u542f<\/h3>\n<p>\u628a\u4ee3\u7801\u52a0\u8fdb\u914d\u7f6e\u6587\u4ef6\u4e2d&#xff0c;\u5728nginx\u5b89\u88c5\u8def\u5f84\u4e0b\u6267\u884cnginx -t\u00a0\u547d\u4ee4\u6d4b\u8bd5\u914d\u7f6e\u662f\u5426\u751f\u6548\u3002\u770b\u4e0d\u61c2\u82f1\u6587\u7684&#xff0c;\u7ffb\u8bd1\u8f6f\u4ef6\u7ffb\u8bd1\u4e00\u4e0b&#xff0c;\u63d0\u793a\u6b63\u786e&#xff0c;\u91cd\u65b0\u52a0\u8f7d\u914d\u7f6e\u3002<\/p>\n<p>#\u3002\u6d4b\u8bd5\u914d\u7f6e\u662f\u5426\u6b63\u786e&#xff0c;\u5b9e\u9645\u73af\u5883\u4e2d\u90fd\u4f1a\u5148\u6d4b\u8bd5\u4e00\u4e0b&#xff0c;\u518d\u91cd\u542f\u5f0e\u6216\u91cd\u65b0\u52a0\u8f7d\u914d\u7f6e<br \/>\nnginx -t<br \/>\n#\u91cd\u65b0\u52a0\u8f7d\u914d\u7f6e<br \/>\nnginx -s reload <\/p>\n<p><img decoding=\"async\" src=\"2025-04-18pzh3s1qy3e1.png\" alt=\"ebdf8131288841acab2a9dac22891d68.png\" \/><\/p>\n<p>\u00a0<\/p>\n<h3>4\u3001\u8bbf\u95ee\u5730\u5740\u6d4b\u8bd5<\/h3>\n<p>\u8bbf\u95eeip\u5730\u5740\u3001\u57df\u540d\u53ef\u8bbf\u95ee\u5230\u4ee3\u7406\u914d\u7f6e\u5bf9\u5e94\u7684\u5730\u5740\u3002<\/p>\n<p><img decoding=\"async\" src=\"2025-04-183hqytqgf2o3.png\" alt=\"198c903aa0dd46d6918fdb63a1403a3b.png\" \/><\/p>\n<p><img decoding=\"async\" src=\"2025-04-180drtc0d3jni.png\" alt=\"ee8510d1f3794ae8b68e5bc6c8a13b6b.png\" \/><\/p>\n<p><img decoding=\"async\" src=\"2025-04-18v3lb1xwn5uu.png\" alt=\"eb010b66702c41448c7756e87820b06b.png\" \/><\/p>\n<p>\u00a0<\/p>\n<h2>\u516b\u3001\u8d1f\u8f7d\u5747\u8861<\/h2>\n<p>\u00a0<\/p>\n<h3>1\u3001\u514b\u9686<\/h3>\n<p>\u4e3a\u4e86\u6f14\u793a&#xff0c;\u8981\u518d\u52a02\u53f0\u670d\u52a1\u5668&#xff0c;\u8fd9\u8fb9\u4ece\u539f\u6765\u6f14\u793a\u7684\u90a3\u4e00\u53f0\u865a\u62df\u673a\u670d\u52a1\u5668\u518d\u514b\u9686\u4e24\u53f0\u3002<\/p>\n<p><img decoding=\"async\" src=\"2025-04-18jpakpsc3w1w.png\" alt=\"b4ca822168104e89a817ce09e8cbf799.png\" \/><\/p>\n<p><img decoding=\"async\" src=\"2025-04-18vrwulmuses4.png\" alt=\"6672608ccde6431b8167836753c8acfd.png\" \/><\/p>\n<p><img decoding=\"async\" src=\"2025-04-18x1blcbqlthr.png\" alt=\"3e63678afda243b59fad1d8d3e64f288.png\" \/><\/p>\n<p><img decoding=\"async\" src=\"2025-04-18cdpsrtfrfup.png\" alt=\"5cc246da4f864ac987b6a94f8b76992b.png\" \/><\/p>\n<p><img decoding=\"async\" src=\"2025-04-1831wbygk3pga.png\" alt=\"3c72d054c94443979da310522b1b89b2.png\" \/><\/p>\n<p>\u6309\u7167\u4e0a\u9762\u7684\u6d41\u7a0b&#xff0c;\u518d\u514b\u9686\u4e00\u53f0\u51fa\u6765<\/p>\n<p><img decoding=\"async\" src=\"2025-04-18ks05me01j4n.png\" alt=\"6c259a89b6ca4ec784c9310c43adbb37.png\" \/><\/p>\n<h3>2\u3001\u542f\u52a8\u670d\u52a1\u5668<\/h3>\n<p>\u628a3\u53f0\u670d\u52a1\u5668\u90fd\u542f\u52a8&#xff0c;\u5e76\u67e5\u770bip&#xff08;\u8bb0\u4e00\u4e0b&#xff0c;\u540e\u9762\u8981\u7528&#xff09;\u3002<\/p>\n<p><img decoding=\"async\" src=\"2025-04-180eomgqj5l4r.png\" alt=\"0290d2ae7ded41fc80ffe65a8d8e6395.png\" \/><\/p>\n<p><img decoding=\"async\" src=\"2025-04-180pglzrs1awp.png\" alt=\"9e3a79b3a38049338b0ff791389935eb.png\" \/><\/p>\n<p><img decoding=\"async\" src=\"2025-04-18hltx0p43o5v.png\" alt=\"2ba42ffcd1d943ce842a0019944418cd.png\" \/><\/p>\n<p>\u00a0<\/p>\n<h3>3\u3001\u4fee\u6539\u65b0\u589e\u7684\u4e24\u53f0\u670d\u52a1nginx.conf\u914d\u7f6e<\/h3>\n<h4>1&#xff09;\u65b0\u589e\u7684\u4e24\u53f0\u670d\u52a1\u5668\u914d\u7f6e<\/h4>\n<p>\u4e00\u4e2a\u53f0\u670d\u52a1\u5668\u914d\u4e00\u4e2aserver\u5c31\u884c&#xff0c;\u8bb0\u5f97\u4fee\u6539\u4e00\u4e0b\u8def\u5f84&#xff0c;\u8ba9\u4e24\u4e2a\u670d\u52a1\u5668\u7684\u9875\u9762\u4e0d\u4e00\u6837\u3002<\/p>\n<p><img decoding=\"async\" src=\"2025-04-18w5jrt5zvzkh.png\" alt=\"929e8b892fd7456397c200243529db39.png\" \/><\/p>\n<p><img decoding=\"async\" src=\"2025-04-18vhzacru5fzn.png\" alt=\"5ef1d5392c564d5abb7b1ee528dc5aae.png\" \/><\/p>\n<p>#\u9ed8\u8ba4\u4e3a1&#xff0c;\u8868\u793a\u5f00\u542f\u4e00\u4e2a\u4e1a\u52a1\u8fdb\u7a0b\u3002\u6839\u636e\u670d\u52a1\u5668\u6838\u6570\u6765\u914d\u7f6e&#xff0c;\u4e00\u822c1\u4e2a\u6838\u5bf9\u5e941\u4e2a\u8fdb\u7a0b<br \/>\nworker_processes  1;<\/p>\n<p>#error_log  logs\/error.log;<br \/>\n#error_log  logs\/error.log  notice;<br \/>\n#error_log  logs\/error.log  info;<\/p>\n<p>events {<br \/>\n#\u5355\u4e2a\u4e1a\u52a1\u8fdb\u7a0b\u53ef\u63a5\u53d7\u8fde\u63a5\u6570<br \/>\n    worker_connections  1024;<br \/>\n}<\/p>\n<p>http {<br \/>\n#\u5f15\u5165http mime\u7c7b\u578b&#xff0c;\u5f15\u5165\u5728conf\u6587\u4ef6\u4e0b\u7684mime.types\u6587\u4ef6,\u8ba9\u6d4f\u89c8\u5668\u77e5\u9053\u8bc6\u522b\u6587\u4ef6\u540e\u7f00\u540d\u540e\u8be5\u5982\u4f55\u5c55\u793a<br \/>\n    include       mime.types;<br \/>\n#\u5982\u679cmime\u7c7b\u578b\u6ca1\u5339\u914d\u4e0a&#xff0c;\u9ed8\u8ba4\u4f7f\u7528\u4e8c\u8fdb\u5236\u6d41\u7684\u65b9\u5f0f\u4f20\u8f93\u3002<br \/>\n    default_type  application\/octet-stream;<\/p>\n<p>#\u4f7f\u7528\u9ad8\u6548\u7f51\u7edc\u4f20\u8f93&#xff0c;\u4e5f\u5c31\u662f\u6570\u636e0\u62f7\u8d1d&#xff0c;\u76f4\u63a5\u4f20\u8f93\u6570\u636e\u3002\u672a\u5f00\u542fsendfile<br \/>\n    sendfile        on;<br \/>\n    #\u4fdd\u6301\u94fe\u63a5\u65f6\u95f4<br \/>\n    keepalive_timeout  65;<\/p>\n<p>    #vhost\u865a\u62df\u4e3b\u673a-1<br \/>\n    server {<br \/>\n        #\u76d1\u542c\u7aef\u53e3\u53f7<br \/>\n        listen       80;<br \/>\n        #\u4e3b\u673a\u540d\\\\\u57df\u540d&#xff0c;\u7a7a\u683c\u540e\u9762\u53ef\u4ee5\u518d\u63a5\u4e00\u4e2a\u57df\u540d&#xff0c;\u652f\u6301\u6b63\u5219&#xff0c;\u4e0d\u540c\u57df\u540d\u540e\u7f00\u4e5f\u53ef\u4ee5\u3002<br \/>\n        server_name  localhost;<br \/>\n        #\u5339\u914d\u8def\u5f84url,\u6837\u4f8b:http:\/\/nginx.org\/en\/download.html<br \/>\n        location \/ {<br \/>\n            #proxy_pass\u4ee3\u7406\u5176\u5b83\u57df\u540d\u7f51\u5740&#xff0c;proxy_pass\u548croot\u53ea\u80fd\u4e8c\u9009\u4e00\u3002<br \/>\n            #proxy_pass https:\/\/www.bilibili.com;<\/p>\n<p>            #\u6587\u4ef6\u6839\u76ee\u5f55&#xff0c;\u76f8\u5bf9\u4e8enginx\u5b89\u88c5\u6839\u76ee\u5f55\u8def\u5f84<br \/>\n            root   C:\/Users\/Administrator\/Desktop\/www;<br \/>\n            #\u9ed8\u8ba4\u9875\u540d\u79f0&#xff0c;\u8bbf\u95ee\u5148\u5230\u8bbf\u9875\u9762<br \/>\n            index  index.html index.htm;<br \/>\n        }<br \/>\n        #\u670d\u52a1\u7aef\u62a5\u9519\u540e\u62a5\u9519\u7f16\u7801\u5bf9\u5e94\u9875\u9762\u3002\u6837\u4f8b:http:\/\/nginx.org\/50x.html<br \/>\n        error_page   500 502 503 504  \/50x.html;<br \/>\n        #\u62a5\u9519\u540e\u8bc6\u522b\u5230\u57df\u540d\u540e\u9762\u8ddf\u4e86\/50x.html&#xff0c;\u5219\u5339\u914d\u5230\u6839\u76ee\u5f55root\u4e0b\u7684html\u6587\u4ef6\u5939<br \/>\n        location &#061; \/50x.html {<br \/>\n            root   html;<br \/>\n        }<br \/>\n    }<\/p>\n<p>}<\/p>\n<h4>2&#xff09;\u542f\u52a8nginx\u5e76\u67e5\u770b\u9875\u9762<\/h4>\n<p>\u542f\u52a8\u6210\u529f\u540e&#xff0c;\u53bb\u6d4f\u89c8\u5668\u8bbf\u95ee\u65b0\u7684\u4e24\u4e2a\u670d\u52a1\u5668ip\u3002<\/p>\n<p><img decoding=\"async\" src=\"2025-04-181kjzmqpgct1.png\" alt=\"f5366d29c313408ebc572ae9a1b24423.png\" \/><\/p>\n<p><img decoding=\"async\" src=\"2025-04-18eggixcvsogz.png\" alt=\"dd10923a87904f4a8de556474c0fcf10.png\" \/><\/p>\n<h3>4\u3001\u539f\u670d\u52a1\u5668\u914d\u7f6e\u8d1f\u8f7d\u5747\u8861<\/h3>\n<h4>1&#xff09;\u81ea\u52a8\u8f6e\u8be2nginx.conf\u4ee3\u7801\u914d\u7f6e<\/h4>\n<p>\u8f6e\u6d41\u8bbf\u95ee\u6bcf\u4e2a\u670d\u52a1\u5668<\/p>\n<p><img decoding=\"async\" src=\"2025-04-18mjlbwpt2mfz.png\" alt=\"0ab54b7c91d14c53a4fb635bc83b288e.png\" \/><\/p>\n<p>#\u9ed8\u8ba4\u4e3a1&#xff0c;\u8868\u793a\u5f00\u542f\u4e00\u4e2a\u4e1a\u52a1\u8fdb\u7a0b\u3002\u6839\u636e\u670d\u52a1\u5668\u6838\u6570\u6765\u914d\u7f6e&#xff0c;\u4e00\u822c1\u4e2a\u6838\u5bf9\u5e941\u4e2a\u8fdb\u7a0b<br \/>\nworker_processes  1;<\/p>\n<p>#error_log  logs\/error.log;<br \/>\n#error_log  logs\/error.log  notice;<br \/>\n#error_log  logs\/error.log  info;<\/p>\n<p>events {<br \/>\n#\u5355\u4e2a\u4e1a\u52a1\u8fdb\u7a0b\u53ef\u63a5\u53d7\u8fde\u63a5\u6570<br \/>\n    worker_connections  1024;<br \/>\n}<\/p>\n<p>http {<br \/>\n#\u5f15\u5165http mime\u7c7b\u578b&#xff0c;\u5f15\u5165\u5728conf\u6587\u4ef6\u4e0b\u7684mime.types\u6587\u4ef6,\u8ba9\u6d4f\u89c8\u5668\u77e5\u9053\u8bc6\u522b\u6587\u4ef6\u540e\u7f00\u540d\u540e\u8be5\u5982\u4f55\u5c55\u793a<br \/>\n    include       mime.types;<br \/>\n#\u5982\u679cmime\u7c7b\u578b\u6ca1\u5339\u914d\u4e0a&#xff0c;\u9ed8\u8ba4\u4f7f\u7528\u4e8c\u8fdb\u5236\u6d41\u7684\u65b9\u5f0f\u4f20\u8f93\u3002<br \/>\n    default_type  application\/octet-stream;<\/p>\n<p>#\u4f7f\u7528\u9ad8\u6548\u7f51\u7edc\u4f20\u8f93&#xff0c;\u4e5f\u5c31\u662f\u6570\u636e0\u62f7\u8d1d&#xff0c;\u76f4\u63a5\u4f20\u8f93\u6570\u636e\u3002\u672a\u5f00\u542fsendfile<br \/>\n    sendfile        on;<br \/>\n    #\u4fdd\u6301\u94fe\u63a5\u65f6\u95f4<br \/>\n    keepalive_timeout  65;<\/p>\n<p>#\u8d1f\u8f7d\u5747\u8861\u670d\u52a1\u5668\u5b9a\u4e49<br \/>\nupstream  asd{<br \/>\nserver 192.168.222.131;<br \/>\nserver 192.168.222.132;<br \/>\n}<\/p>\n<p>    #vhost\u865a\u62df\u4e3b\u673a-1<br \/>\n    server {<br \/>\n        #\u76d1\u542c\u7aef\u53e3\u53f7<br \/>\n        listen       80;<br \/>\n        #\u4e3b\u673a\u540d\\\\\u57df\u540d&#xff0c;\u7a7a\u683c\u540e\u9762\u53ef\u4ee5\u518d\u63a5\u4e00\u4e2a\u57df\u540d&#xff0c;\u652f\u6301\u6b63\u5219&#xff0c;\u4e0d\u540c\u57df\u540d\u540e\u7f00\u4e5f\u53ef\u4ee5\u3002<br \/>\n        server_name  www.lingran.website;<br \/>\n        #\u5339\u914d\u8def\u5f84url,\u6837\u4f8b:http:\/\/nginx.org\/en\/download.html<br \/>\n        location \/ {<br \/>\n            #proxy_pass\u4ee3\u7406\u5176\u5b83\u57df\u540d\u7f51\u5740&#xff0c;proxy_pass\u548croot\u53ea\u80fd\u4e8c\u9009\u4e00\u3002<br \/>\n            proxy_pass http:\/\/asd;<\/p>\n<p>            #\u6587\u4ef6\u6839\u76ee\u5f55&#xff0c;\u76f8\u5bf9\u4e8enginx\u5b89\u88c5\u6839\u76ee\u5f55\u8def\u5f84<br \/>\n            #root   C:\/Users\/Administrator\/Desktop\/www;<br \/>\n            #\u9ed8\u8ba4\u9875\u540d\u79f0&#xff0c;\u8bbf\u95ee\u5148\u5230\u8bbf\u9875\u9762<br \/>\n            #index  index.html index.htm;<br \/>\n        }<br \/>\n        #\u670d\u52a1\u7aef\u62a5\u9519\u540e\u62a5\u9519\u7f16\u7801\u5bf9\u5e94\u9875\u9762\u3002\u6837\u4f8b:http:\/\/nginx.org\/50x.html<br \/>\n        error_page   500 502 503 504  \/50x.html;<br \/>\n        #\u62a5\u9519\u540e\u8bc6\u522b\u5230\u57df\u540d\u540e\u9762\u8ddf\u4e86\/50x.html&#xff0c;\u5219\u5339\u914d\u5230\u6839\u76ee\u5f55root\u4e0b\u7684html\u6587\u4ef6\u5939<br \/>\n        location &#061; \/50x.html {<br \/>\n            root   html;<br \/>\n        }<br \/>\n    }<\/p>\n<p>}<\/p>\n<h4>2&#xff09;\u6d4b\u8bd5<\/h4>\n<p>\u8bbf\u95ee\u670d\u52a1\u5668ip&#xff0c;\u80fd\u8f6e\u6d41\u8bbf\u95ee\u5230\u4e24\u4e2a\u65b0\u589e\u670d\u52a1\u5668\u7684\u9875\u9762<\/p>\n<p><img decoding=\"async\" src=\"2025-04-18udw4zjilfnf.png\" alt=\"2331706cc3dd400db2cdb6143843aeec.png\" \/><\/p>\n<p><img decoding=\"async\" src=\"2025-04-18ypyogg0wuyh.png\" alt=\"fa2163f5d3254d2d82b17f7dac6f909c.png\" \/><\/p>\n<h4>3&#xff09;\u6743\u91cd\u8f6e\u8be2&#xff08;weight&#xff09;<\/h4>\n<p>weight&#xff1a;\u9ed8\u8ba4\u4e3a1.weight\u8d8a\u5927&#xff0c;\u8d1f\u8f7d\u7684\u6743\u91cd\u5c31\u8d8a\u5927&#xff0c;\u6309\u5206\u914d\u7684\u6743\u91cd\u6bd4\u4f8b\u5206\u914d\u8bbf\u95ee\u6b21\u6570\u3002<\/p>\n<p><img decoding=\"async\" src=\"2025-04-18ou2hxqaohv3.png\" alt=\"6d8d34247ffd42808a08dfd13d1db5dc.png\" \/><\/p>\n<p>#\u9ed8\u8ba4\u4e3a1&#xff0c;\u8868\u793a\u5f00\u542f\u4e00\u4e2a\u4e1a\u52a1\u8fdb\u7a0b\u3002\u6839\u636e\u670d\u52a1\u5668\u6838\u6570\u6765\u914d\u7f6e&#xff0c;\u4e00\u822c1\u4e2a\u6838\u5bf9\u5e941\u4e2a\u8fdb\u7a0b<br \/>\nworker_processes  1;<\/p>\n<p>#error_log  logs\/error.log;<br \/>\n#error_log  logs\/error.log  notice;<br \/>\n#error_log  logs\/error.log  info;<\/p>\n<p>events {<br \/>\n#\u5355\u4e2a\u4e1a\u52a1\u8fdb\u7a0b\u53ef\u63a5\u53d7\u8fde\u63a5\u6570<br \/>\n    worker_connections  1024;<br \/>\n}<\/p>\n<p>http {<br \/>\n#\u5f15\u5165http mime\u7c7b\u578b&#xff0c;\u5f15\u5165\u5728conf\u6587\u4ef6\u4e0b\u7684mime.types\u6587\u4ef6,\u8ba9\u6d4f\u89c8\u5668\u77e5\u9053\u8bc6\u522b\u6587\u4ef6\u540e\u7f00\u540d\u540e\u8be5\u5982\u4f55\u5c55\u793a<br \/>\n    include       mime.types;<br \/>\n#\u5982\u679cmime\u7c7b\u578b\u6ca1\u5339\u914d\u4e0a&#xff0c;\u9ed8\u8ba4\u4f7f\u7528\u4e8c\u8fdb\u5236\u6d41\u7684\u65b9\u5f0f\u4f20\u8f93\u3002<br \/>\n    default_type  application\/octet-stream;<\/p>\n<p>#\u4f7f\u7528\u9ad8\u6548\u7f51\u7edc\u4f20\u8f93&#xff0c;\u4e5f\u5c31\u662f\u6570\u636e0\u62f7\u8d1d&#xff0c;\u76f4\u63a5\u4f20\u8f93\u6570\u636e\u3002\u672a\u5f00\u542fsendfile<br \/>\n    sendfile        on;<br \/>\n    #\u4fdd\u6301\u94fe\u63a5\u65f6\u95f4<br \/>\n    keepalive_timeout  65;<\/p>\n<p>#upstream\u8d1f\u8f7d\u5747\u8861\u670d\u52a1\u5668\u5b9a\u4e49&#xff0c;weight\u6743\u91cd\u5206\u914d<br \/>\nupstream  asd{<br \/>\nserver 192.168.222.131 weight&#061;8;<br \/>\nserver 192.168.222.132 weight&#061;2;<br \/>\n}<\/p>\n<p>    #vhost\u865a\u62df\u4e3b\u673a-1<br \/>\n    server {<br \/>\n        #\u76d1\u542c\u7aef\u53e3\u53f7<br \/>\n        listen       80;<br \/>\n        #\u4e3b\u673a\u540d\\\\\u57df\u540d&#xff0c;\u7a7a\u683c\u540e\u9762\u53ef\u4ee5\u518d\u63a5\u4e00\u4e2a\u57df\u540d&#xff0c;\u652f\u6301\u6b63\u5219&#xff0c;\u4e0d\u540c\u57df\u540d\u540e\u7f00\u4e5f\u53ef\u4ee5\u3002<br \/>\n        server_name  www.lingran.website;<br \/>\n        #\u5339\u914d\u8def\u5f84url,\u6837\u4f8b:http:\/\/nginx.org\/en\/download.html<br \/>\n        location \/ {<br \/>\n            #proxy_pass\u4ee3\u7406\u5176\u5b83\u57df\u540d\u7f51\u5740&#xff0c;proxy_pass\u548croot\u53ea\u80fd\u4e8c\u9009\u4e00\u3002<br \/>\n            proxy_pass http:\/\/asd;<\/p>\n<p>            #\u6587\u4ef6\u6839\u76ee\u5f55&#xff0c;\u76f8\u5bf9\u4e8enginx\u5b89\u88c5\u6839\u76ee\u5f55\u8def\u5f84<br \/>\n            #root   C:\/Users\/Administrator\/Desktop\/www;<br \/>\n            #\u9ed8\u8ba4\u9875\u540d\u79f0&#xff0c;\u8bbf\u95ee\u5148\u5230\u8bbf\u9875\u9762<br \/>\n            #index  index.html index.htm;<br \/>\n        }<br \/>\n        #\u670d\u52a1\u7aef\u62a5\u9519\u540e\u62a5\u9519\u7f16\u7801\u5bf9\u5e94\u9875\u9762\u3002\u6837\u4f8b:http:\/\/nginx.org\/50x.html<br \/>\n        error_page   500 502 503 504  \/50x.html;<br \/>\n        #\u62a5\u9519\u540e\u8bc6\u522b\u5230\u57df\u540d\u540e\u9762\u8ddf\u4e86\/50x.html&#xff0c;\u5219\u5339\u914d\u5230\u6839\u76ee\u5f55root\u4e0b\u7684html\u6587\u4ef6\u5939<br \/>\n        location &#061; \/50x.html {<br \/>\n            root   html;<br \/>\n        }<br \/>\n    }<\/p>\n<p>}<\/p>\n<h4>4&#xff09;down\u548cbackup<\/h4>\n<p>1.down&#xff1a;<\/p>\n<p>\u662f\u5728upstream\u8d1f\u8f7d\u5747\u8861\u670d\u52a1\u5668\u5b9a\u4e49\u4e2d&#xff0c;\u5bf9\u5176\u4e2d\u7684\u670d\u52a1\u5668\u505a\u4e0b\u7ebf\u6807\u8bb0&#xff0c;\u4e0d\u8fc7\u4e0d\u600e\u4e48\u7528&#xff0c;\u4e00\u822c\u60f3\u8981\u4e0b\u7ebf\u670d\u52a1\u5668\u76f4\u63a5\u6ce8\u91ca\u6389\u5c31\u884c\u3002<\/p>\n<p>#upstream\u8d1f\u8f7d\u5747\u8861\u670d\u52a1\u5668\u5b9a\u4e49&#xff0c;weight\u6743\u91cd\u5206\u914d<br \/>\nupstream  asd{<br \/>\nserver 192.168.222.131 weight&#061;8 down;<br \/>\nserver 192.168.222.132 weight&#061;2;<br \/>\n} <\/p>\n<p>2.backup&#xff1a;<\/p>\n<p>\u662f\u5728upstream\u8d1f\u8f7d\u5747\u8861\u670d\u52a1\u5668\u5b9a\u4e49\u4e2d&#xff0c;\u5b9a\u4e49\u8fd9\u4e2a\u670d\u52a1\u5668\u662f\u5f85\u673a\u670d\u52a1\u5668&#xff0c;\u53ea\u6709\u5176\u4ed6\u670d\u52a1\u5668\u5168\u5b95\u4e86&#xff0c;\u624d\u4f1a\u7528\u5230\u5f85\u673a\u670d\u52a1\u5668\u3002<\/p>\n<p>#upstream\u8d1f\u8f7d\u5747\u8861\u670d\u52a1\u5668\u5b9a\u4e49&#xff0c;weight\u6743\u91cd\u5206\u914d<br \/>\nupstream  asd{<br \/>\nserver 192.168.222.131 weight&#061;8;<br \/>\nserver 192.168.222.132 weight&#061;2;<br \/>\nserver 192.168.222.132 weight&#061;2 backup;<\/p>\n<p>} <\/p>\n<h4>5&#xff09;\u4e0d\u5e38\u7528&#xff08;ip_hash\u3001least_conn\u3001url_hash\u3001fair&#xff09;<\/h4>\n<p>1.ip_hash<\/p>\n<p>  \u6839\u636e\u5ba2\u6237\u7aef\u7684ip\u5730\u5740\u8f6c\u53d1\u540c\u4e00\u53f0\u670d\u52a1\u5668&#xff0c;\u53ef\u4ee5\u4fdd\u6301\u4f1a\u8bdd\u3002\u524d\u63d0\u662f\u7528\u6237ip\u6ca1\u6709\u53d1\u751f\u66f4\u6539\u3002 <\/p>\n<p>  \u5982\u679c\u9700\u8981\u4e34\u65f6\u5220\u9664\u5176\u4e2d\u4e00\u53f0\u670d\u52a1\u5668&#xff0c;\u5219\u5e94\u7528\u4e3a\u4e86\u4fdd\u7559\u5ba2\u6237\u7aef IP \u5730\u5740&#xff0c;\u53ea\u80fd\u6807\u8bb0 down \u3002 <\/p>\n<p>#upstream\u8d1f\u8f7d\u5747\u8861\u670d\u52a1\u5668\u5b9a\u4e49&#xff0c;weight\u6743\u91cd\u5206\u914d<br \/>\nupstream  asd{<br \/>\n    #\u4fdd\u6301\u540c\u4e00\u4e2a\u5730\u5740\u8bbf\u95ee\u540c\u4e00\u4e2a\u670d\u52a1\u5668<br \/>\n    ip_hash;<br \/>\nserver 192.168.222.131 weight&#061;8;<br \/>\nserver 192.168.222.132 weight&#061;2;<br \/>\nserver 192.168.222.132 weight&#061;2 down;<\/p>\n<p>} <\/p>\n<p>\u00a0<\/p>\n<p>2.least_conn<\/p>\n<p>\u6307\u5b9a\u7ec4\u5e94\u4f7f\u7528\u8d1f\u8f7d\u5e73\u8861\u65b9\u6cd5&#xff0c;\u5176\u4e2d\u8bf7\u6c42\u4f20\u9012\u5230\u6d3b\u52a8\u8fde\u63a5\u6570\u6700\u5c11\u7684\u670d\u52a1\u5668&#xff0c; \u8003\u8651\u5230\u670d\u52a1\u5668\u7684\u6743\u91cd\u3002 \u5982\u679c\u6709\u591a\u4e2a\u8fd9\u6837\u7684\u670d\u52a1\u5668&#xff0c;\u5219\u4f7f\u7528\u52a0\u6743\u5faa\u73af\u5e73\u8861\u6cd5\u3002<\/p>\n<p>\u00a0<\/p>\n<p>\u9009\u62e9\u6d3b\u8dc3\u8fde\u63a5\u6570\u4e0e\u6743\u91cdweight\u7684\u6bd4\u503c\u6700\u5c0f\u8005\u4e3a\u4e0b\u4e00\u4e2a\u5904\u7406\u8bf7\u6c42\u7684server\u3002\u4e0a\u6b21\u5df2\u9009\u7684server\u548c\u5df2\u8fbe\u5230\u6700\u5927\u8fde\u63a5\u6570\u7684server\u7684\u4e0d\u5728\u9009\u62e9\u8303\u56f4\u3002<\/p>\n<p>\u52a0\u6743\u5faa\u73af\u5e73\u8861\u6cd5<\/p>\n<p>\u5982\u4e00\u4e2aupstream\u6709\u4e09\u53f0server:<\/p>\n<p>#upstream\u8d1f\u8f7d\u5747\u8861\u670d\u52a1\u5668\u5b9a\u4e49&#xff0c;weight\u6743\u91cd\u5206\u914d<br \/>\nupstream aaa {<br \/>\n    #\u9009\u53d6\u6d3b\u8dc3\u8fde\u63a5\u6570\u4e0e\u6743\u91cdweight\u7684\u6bd4\u503c\u6700\u5c0f\u8005\u4e3a\u4e0b\u4e00\u4e2a\u5904\u7406\u8bf7\u6c42\u7684server<br \/>\n    least_conn;<br \/>\nserver 192.168.222.131 weight&#061;8;<br \/>\nserver 192.168.222.132 weight&#061;2;<br \/>\nserver 192.168.222.132 weight&#061;2;<br \/>\n}<\/p>\n<p>\u5982\u4e0a\u4e00\u4e2a\u8bf7\u6c42\u9009\u62e9\u4e86\u7b2c\u4e8c\u53f0192.168.222.132&#xff0c;\u4e0b\u4e00\u4e2a\u8bf7\u6c42\u5230\u6765&#xff0c;\u901a\u8fc7\u6bd4\u8f83\u5269\u4e0b\u53ef\u7528\u7684server\u7684conns(\u8fde\u63a5\u6570)\/weight\u7684\u503c&#xff0c;\u51b3\u5b9a\u54ea\u4e00\u53f0\u3002<\/p>\n<p>\u5982\u679c192.168.222.131\u8fde\u63a5\u6570\u4e3a40&#xff0c;192.168.222.133\u8fde\u63a5\u6570\u4e3a8&#xff0c;\u6743\u91cd\u5206\u522b\u662f8\u548c2&#xff0c;\u8ba1\u7b97\u7ed3\u679c 192.168.222.131&#xff1a;40\/8&#061;5<\/p>\n<p>192.168.222.132&#xff1a;8\/2&#061;4<\/p>\n<p>\u56e0\u4e3a 5 &gt;\u00a04&#xff0c;\u56e0\u4e3a192.168.222.132\u7684\u6700\u5c0f\u4e14\u94fe\u63a5\u6570\u672a\u6ee1&#xff0c;\u6240\u4ee5\u9009\u62e9192.168.222.132\u800c\u4e0d\u9009192.168.222.131\u3002\u5c3d\u7ba1\u8fde\u63a5\u6570192.168.222.131\u8981\u5927\u4e8e192.168.222.132\u3002<\/p>\n<p>3.url_hash<\/p>\n<p>  \u5b9a\u5411\u6d41\u91cf\u8f6c\u53d1&#xff0c;\u6839\u636e\u7528\u6237\u8bbf\u95ee\u7684url\u5b9a\u5411\u8f6c\u53d1\u8bf7\u6c42&#xff0c;\u4e3b\u8981\u7528\u4e8e\u8bbf\u95ee\u56fa\u5b9a\u4f4d\u7f6e\u7684\u8d44\u6e90&#xff0c;\u5982\u4e0b\u8f7d\u6587\u4ef6 <\/p>\n<p>  \u00a0 <\/p>\n<p>#upstream\u8d1f\u8f7d\u5747\u8861\u670d\u52a1\u5668\u5b9a\u4e49&#xff0c;weight\u6743\u91cd\u5206\u914d<br \/>\nupstream aaa {<br \/>\n    #\u4e3b\u8981\u7528\u4e8e\u8bbf\u95ee\u56fa\u5b9a\u4f4d\u7f6e\u7684\u8d44\u6e90&#xff0c;\u5982\u4e0b\u8f7d\u6587\u4ef6<br \/>\n    hash $request_uri;<br \/>\nserver 192.168.222.131 weight&#061;8;<br \/>\nserver 192.168.222.132 weight&#061;2;<br \/>\nserver 192.168.222.132 weight&#061;2;<br \/>\n}<\/p>\n<p>4.fair<\/p>\n<p>  \u6839\u636e\u540e\u7aef\u670d\u52a1\u5668\u54cd\u5e94\u65f6\u95f4\u8f6c\u53d1\u8bf7\u6c42&#xff0c;\u57fa\u4e8e\u6bcf\u4e2a\u540e\u7aef\u670d\u52a1\u5668\u7684\u54cd\u5e94\u65f6\u95f4\u548c\u8fde\u63a5\u6570\u6765\u52a8\u6001\u8c03\u6574\u6743\u91cd <\/p>\n<p>  \u00a0 <\/p>\n<p>#upstream\u8d1f\u8f7d\u5747\u8861\u670d\u52a1\u5668\u5b9a\u4e49&#xff0c;weight\u6743\u91cd\u5206\u914d<br \/>\nupstream aaa {<br \/>\n    fair;<br \/>\nserver 192.168.222.131 weight&#061;8;<br \/>\nserver 192.168.222.132 weight&#061;2;<br \/>\nserver 192.168.222.132 weight&#061;2;<br \/>\n}<\/p>\n<p>\u00a0<\/p>\n<h2>\u4e5d\u3001\u52a8\u9759\u5206\u79bb<\/h2>\n<p>\u5c06 css\u3001img\u3001js\u7b49\u8fd9\u4e9b\u914d\u7f6e\u6587\u4ef6&#xff0c;\u653e\u5230nginx\u670d\u52a1\u5668\u4e0a&#xff0c;\u4e0d\u7528\u653e\u5728\u540e\u9762\u7684\u670d\u52a1\u5668\u4e0a\u3002<\/p>\n<h3>1\u3001\u666e\u901a\u914d\u7f6e<\/h3>\n<p>\u00a0<\/p>\n<p><img decoding=\"async\" src=\"2025-04-184jhu5k15nd2.png\" alt=\"d39084fbb3bd4293a2a0097dc11a11c6.png\" \/><\/p>\n<p>#\u9ed8\u8ba4\u4e3a1&#xff0c;\u8868\u793a\u5f00\u542f\u4e00\u4e2a\u4e1a\u52a1\u8fdb\u7a0b\u3002\u6839\u636e\u670d\u52a1\u5668\u6838\u6570\u6765\u914d\u7f6e&#xff0c;\u4e00\u822c1\u4e2a\u6838\u5bf9\u5e941\u4e2a\u8fdb\u7a0b<br \/>\nworker_processes  1;<\/p>\n<p>#error_log  logs\/error.log;<br \/>\n#error_log  logs\/error.log  notice;<br \/>\n#error_log  logs\/error.log  info;<\/p>\n<p>events {<br \/>\n#\u5355\u4e2a\u4e1a\u52a1\u8fdb\u7a0b\u53ef\u63a5\u53d7\u8fde\u63a5\u6570<br \/>\n    worker_connections  1024;<br \/>\n}<\/p>\n<p>http {<br \/>\n#\u5f15\u5165http mime\u7c7b\u578b&#xff0c;\u5f15\u5165\u5728conf\u6587\u4ef6\u4e0b\u7684mime.types\u6587\u4ef6,\u8ba9\u6d4f\u89c8\u5668\u77e5\u9053\u8bc6\u522b\u6587\u4ef6\u540e\u7f00\u540d\u540e\u8be5\u5982\u4f55\u5c55\u793a<br \/>\n    include       mime.types;<br \/>\n#\u5982\u679cmime\u7c7b\u578b\u6ca1\u5339\u914d\u4e0a&#xff0c;\u9ed8\u8ba4\u4f7f\u7528\u4e8c\u8fdb\u5236\u6d41\u7684\u65b9\u5f0f\u4f20\u8f93\u3002<br \/>\n    default_type  application\/octet-stream;<\/p>\n<p>#\u4f7f\u7528\u9ad8\u6548\u7f51\u7edc\u4f20\u8f93&#xff0c;\u4e5f\u5c31\u662f\u6570\u636e0\u62f7\u8d1d&#xff0c;\u76f4\u63a5\u4f20\u8f93\u6570\u636e\u3002\u672a\u5f00\u542fsendfile<br \/>\n    sendfile        on;<br \/>\n    #\u4fdd\u6301\u94fe\u63a5\u65f6\u95f4<br \/>\n    keepalive_timeout  65;<\/p>\n<p>#\u8d1f\u8f7d\u5747\u8861\u670d\u52a1\u5668\u5b9a\u4e49<br \/>\nupstream  asd{<br \/>\nserver 192.168.222.131;<br \/>\nserver 192.168.222.132;<br \/>\n}<\/p>\n<p>    #vhost\u865a\u62df\u4e3b\u673a-1<br \/>\n    server {<br \/>\n        #\u76d1\u542c\u7aef\u53e3\u53f7<br \/>\n        listen       80;<br \/>\n        #\u4e3b\u673a\u540d\\\\\u57df\u540d&#xff0c;\u7a7a\u683c\u540e\u9762\u53ef\u4ee5\u518d\u63a5\u4e00\u4e2a\u57df\u540d&#xff0c;\u652f\u6301\u6b63\u5219&#xff0c;\u4e0d\u540c\u57df\u540d\u540e\u7f00\u4e5f\u53ef\u4ee5\u3002<br \/>\n        server_name  www.lingran.website;<br \/>\n        #\u5339\u914d\u8def\u5f84url,\u6837\u4f8b:http:\/\/nginx.org\/en\/download.html<br \/>\n        location \/ {<br \/>\n            #proxy_pass\u4ee3\u7406\u5176\u5b83\u57df\u540d\u7f51\u5740&#xff0c;proxy_pass\u548croot\u53ea\u80fd\u4e8c\u9009\u4e00\u3002<br \/>\n            proxy_pass http:\/\/asd;<\/p>\n<p>            #\u6587\u4ef6\u6839\u76ee\u5f55&#xff0c;\u76f8\u5bf9\u4e8enginx\u5b89\u88c5\u6839\u76ee\u5f55\u8def\u5f84<br \/>\n            #root   C:\/Users\/Administrator\/Desktop\/www;<br \/>\n            #\u9ed8\u8ba4\u9875\u540d\u79f0&#xff0c;\u8bbf\u95ee\u5148\u5230\u8bbf\u9875\u9762<br \/>\n            #index  index.html index.htm;<br \/>\n        }<br \/>\n        #\u914d\u7f6ecss&#xff0c;\u5230root\u540e\u9762\u7684\u8def\u5f84&#xff0c;\u5339\u914dcss<br \/>\n        location \/css {<\/p>\n<p>            #\u6587\u4ef6\u6839\u76ee\u5f55&#xff0c;\u76f8\u5bf9\u4e8enginx\u5b89\u88c5\u6839\u76ee\u5f55\u8def\u5f84<br \/>\n            root   C:\/Users\/Administrator\/Desktop\/www;<br \/>\n            index  index.html index.htm;<br \/>\n        }<br \/>\n        #\u914d\u7f6ejs&#xff0c;\u5230root\u540e\u9762\u7684\u8def\u5f84&#xff0c;\u5339\u914djs<br \/>\n        location \/js {<\/p>\n<p>            #\u6587\u4ef6\u6839\u76ee\u5f55&#xff0c;\u76f8\u5bf9\u4e8enginx\u5b89\u88c5\u6839\u76ee\u5f55\u8def\u5f84<br \/>\n            root   C:\/Users\/Administrator\/Desktop\/www;<br \/>\n            index  index.html index.htm;<br \/>\n        }<\/p>\n<p>        #\u670d\u52a1\u7aef\u62a5\u9519\u540e\u62a5\u9519\u7f16\u7801\u5bf9\u5e94\u9875\u9762\u3002\u6837\u4f8b:http:\/\/nginx.org\/50x.html<br \/>\n        error_page   500 502 503 504  \/50x.html;<br \/>\n        #\u62a5\u9519\u540e\u8bc6\u522b\u5230\u57df\u540d\u540e\u9762\u8ddf\u4e86\/50x.html&#xff0c;\u5219\u5339\u914d\u5230\u6839\u76ee\u5f55root\u4e0b\u7684html\u6587\u4ef6\u5939<br \/>\n        location &#061; \/50x.html {<br \/>\n            root   html;<br \/>\n        }<br \/>\n    }<\/p>\n<p>}<\/p>\n<h3>2\u3001\u6b63\u5219\u914d\u7f6e<\/h3>\n<p>\u6b63\u5219\u57fa\u672c\u7528\u6cd5\u8981\u6709\u4e00\u4e9b\u4e86\u89e3<\/p>\n<p><img decoding=\"async\" src=\"2025-04-18lvnh5nc2kcc.png\" alt=\"8f0975b4882a48fdba77457782237395.png\" \/><\/p>\n<p>#\u9ed8\u8ba4\u4e3a1&#xff0c;\u8868\u793a\u5f00\u542f\u4e00\u4e2a\u4e1a\u52a1\u8fdb\u7a0b\u3002\u6839\u636e\u670d\u52a1\u5668\u6838\u6570\u6765\u914d\u7f6e&#xff0c;\u4e00\u822c1\u4e2a\u6838\u5bf9\u5e941\u4e2a\u8fdb\u7a0b<br \/>\nworker_processes  1;<\/p>\n<p>#error_log  logs\/error.log;<br \/>\n#error_log  logs\/error.log  notice;<br \/>\n#error_log  logs\/error.log  info;<\/p>\n<p>events {<br \/>\n#\u5355\u4e2a\u4e1a\u52a1\u8fdb\u7a0b\u53ef\u63a5\u53d7\u8fde\u63a5\u6570<br \/>\n    worker_connections  1024;<br \/>\n}<\/p>\n<p>http {<br \/>\n#\u5f15\u5165http mime\u7c7b\u578b&#xff0c;\u5f15\u5165\u5728conf\u6587\u4ef6\u4e0b\u7684mime.types\u6587\u4ef6,\u8ba9\u6d4f\u89c8\u5668\u77e5\u9053\u8bc6\u522b\u6587\u4ef6\u540e\u7f00\u540d\u540e\u8be5\u5982\u4f55\u5c55\u793a<br \/>\n    include       mime.types;<br \/>\n#\u5982\u679cmime\u7c7b\u578b\u6ca1\u5339\u914d\u4e0a&#xff0c;\u9ed8\u8ba4\u4f7f\u7528\u4e8c\u8fdb\u5236\u6d41\u7684\u65b9\u5f0f\u4f20\u8f93\u3002<br \/>\n    default_type  application\/octet-stream;<\/p>\n<p>#\u4f7f\u7528\u9ad8\u6548\u7f51\u7edc\u4f20\u8f93&#xff0c;\u4e5f\u5c31\u662f\u6570\u636e0\u62f7\u8d1d&#xff0c;\u76f4\u63a5\u4f20\u8f93\u6570\u636e\u3002\u672a\u5f00\u542fsendfile<br \/>\n    sendfile        on;<br \/>\n    #\u4fdd\u6301\u94fe\u63a5\u65f6\u95f4<br \/>\n    keepalive_timeout  65;<\/p>\n<p>#\u8d1f\u8f7d\u5747\u8861\u670d\u52a1\u5668\u5b9a\u4e49<br \/>\nupstream  asd{<br \/>\nserver 192.168.222.131;<br \/>\nserver 192.168.222.132;<br \/>\n}<\/p>\n<p>    #vhost\u865a\u62df\u4e3b\u673a-1<br \/>\n    server {<br \/>\n        #\u76d1\u542c\u7aef\u53e3\u53f7<br \/>\n        listen       80;<br \/>\n        #\u4e3b\u673a\u540d\\\\\u57df\u540d&#xff0c;\u7a7a\u683c\u540e\u9762\u53ef\u4ee5\u518d\u63a5\u4e00\u4e2a\u57df\u540d&#xff0c;\u652f\u6301\u6b63\u5219&#xff0c;\u4e0d\u540c\u57df\u540d\u540e\u7f00\u4e5f\u53ef\u4ee5\u3002<br \/>\n        server_name  www.lingran.website;<br \/>\n        #\u5339\u914d\u8def\u5f84url,\u6837\u4f8b:http:\/\/nginx.org\/en\/download.html<br \/>\n        location \/ {<br \/>\n            #proxy_pass\u4ee3\u7406\u5176\u5b83\u57df\u540d\u7f51\u5740&#xff0c;proxy_pass\u548croot\u53ea\u80fd\u4e8c\u9009\u4e00\u3002<br \/>\n            proxy_pass http:\/\/asd;<\/p>\n<p>            #\u6587\u4ef6\u6839\u76ee\u5f55&#xff0c;\u76f8\u5bf9\u4e8enginx\u5b89\u88c5\u6839\u76ee\u5f55\u8def\u5f84<br \/>\n            #root   C:\/Users\/Administrator\/Desktop\/www;<br \/>\n            #\u9ed8\u8ba4\u9875\u540d\u79f0&#xff0c;\u8bbf\u95ee\u5148\u5230\u8bbf\u9875\u9762<br \/>\n            #index  index.html index.htm;<br \/>\n        }<br \/>\n        #~\u8868\u793a\u8981\u4f7f\u7528\u6b63\u5219\u4e86&#xff0c;*\u8868\u793a\u4e0d\u533a\u5206\u5927\u5c0f\u5199&#xff0c;|\u9694\u5f00\u4eca\u5199\u591a\u4e2a<br \/>\n        location ~*\/(css|js|img) {<br \/>\n            #\u8fd9\u4e09\u4e2a\u9759\u6001\u6587\u4ef6\u5939css\u3001js\u3001img&#xff0c;\u8981\u5728\u4e0b\u9762\u7684\u8def\u5f84\u91cc<br \/>\n            root   C:\/Users\/Administrator\/Desktop\/www;<br \/>\n            index  index.html index.htm;<br \/>\n        }<\/p>\n<p>        #\u670d\u52a1\u7aef\u62a5\u9519\u540e\u62a5\u9519\u7f16\u7801\u5bf9\u5e94\u9875\u9762\u3002\u6837\u4f8b:http:\/\/nginx.org\/50x.html<br \/>\n        error_page   500 502 503 504  \/50x.html;<br \/>\n        #\u62a5\u9519\u540e\u8bc6\u522b\u5230\u57df\u540d\u540e\u9762\u8ddf\u4e86\/50x.html&#xff0c;\u5219\u5339\u914d\u5230\u6839\u76ee\u5f55root\u4e0b\u7684html\u6587\u4ef6\u5939<br \/>\n        location &#061; \/50x.html {<br \/>\n            root   html;<br \/>\n        }<br \/>\n    }<\/p>\n<p>}<\/p>\n<p>\u00a0<\/p>\n<h2>\u5341\u3001UrlRewrite<\/h2>\n<h3>1\u3001\u53c2\u6570\u8be6\u60c5<\/h3>\n<p>\u5730\u5740\u91cd\u5199&#xff0c;\u7528\u6237\u5f97\u5230\u7684\u90fd\u662f\u7ecf\u8fc7\u5904\u7406\u540e\u7684URL\u5730\u5740\u3002<\/p>\n<p>#\u6837\u4f8b<br \/>\nrewrite ^\/([0-9]&#043;).html$ \/index.jsp?pageNum&#061;$1 break; <\/p>\n<p><img decoding=\"async\" src=\"2025-04-18534h4ndnfab.png\" alt=\"2649c29ee4974004b84b38e439c15646.png\" \/><\/p>\n<p>rewrite \u00a0 \u00a0 &lt;regex&gt; \u00a0 \u00a0 &lt;replacement&gt; \u00a0 \u00a0 [flag]; \u5173\u952e\u5b57 \u00a0 \u00a0 \u00a0 \u00a0 \u6b63\u5219 \u00a0 \u00a0 \u00a0 \u00a0 \u66ff\u4ee3\u5185\u5bb9 \u00a0 \u00a0 \u00a0 \u00a0 flag\u6807\u8bb0<\/p>\n<p>\u5173\u952e\u5b57&#xff1a;\u5173\u952e\u5b57rewrite\u4e0d\u80fd\u6539\u53d8\u6b63\u5219&#xff1a;\u6b63\u5219\u8868\u8fbe\u5f0f\u8bed\u53e5\u8fdb\u884c\u89c4\u5219\u5339\u914d\u66ff\u4ee3\u5185\u5bb9&#xff1a;\u5c06\u6b63\u5219\u5339\u914d\u7684\u5185\u5bb9\u66ff\u6362\u6210replacement<\/p>\n<p>flag\u6807\u8bb0\u8bf4\u660e&#xff1a;<\/p>\n<p>1\u3001last \u672c\u6761\u89c4\u5219\u5339\u914d\u5b8c\u6210\u540e&#xff0c;\u7ee7\u7eed\u5411\u4e0b\u5339\u914d\u65b0\u7684location URI\u89c4\u52192\u3001break \u672c\u6761\u89c4\u5219\u5339\u914d\u5b8c\u6210\u5373\u7ec8\u6b62&#xff0c;\u4e0d\u518d\u5339\u914d\u540e\u9762\u7684\u4efb\u4f55\u89c4\u5219<\/p>\n<p>3\u3001redirect \u8fd4\u56de302\u4e34\u65f6\u91cd\u5b9a\u5411&#xff0c;\u6d4f\u89c8\u5668\u5730\u5740\u4f1a\u663e\u793a\u8df3\u8f6c\u540e\u7684URL\u5730\u5740<\/p>\n<p>4\u3001permanent \u8fd4\u56de301\u6c38\u4e45\u91cd\u5b9a\u5411&#xff0c;\u6d4f\u89c8\u5668\u5730\u5740\u680f\u4f1a\u663e\u793a\u8df3\u8f6c\u540e\u7684URL\u5730\u5740<\/p>\n<p>\u00a0<\/p>\n<h3>2\u3001nginx.conf\u914d\u7f6e<\/h3>\n<p>\u00a0<\/p>\n<p><img decoding=\"async\" src=\"2025-04-18q3akvsjiemp.png\" alt=\"5193c61d56504f06a3c992b8fd29320c.png\" \/><\/p>\n<p>#\u9ed8\u8ba4\u4e3a1&#xff0c;\u8868\u793a\u5f00\u542f\u4e00\u4e2a\u4e1a\u52a1\u8fdb\u7a0b\u3002\u6839\u636e\u670d\u52a1\u5668\u6838\u6570\u6765\u914d\u7f6e&#xff0c;\u4e00\u822c1\u4e2a\u6838\u5bf9\u5e941\u4e2a\u8fdb\u7a0b<br \/>\nworker_processes  1;<\/p>\n<p>#error_log  logs\/error.log;<br \/>\n#error_log  logs\/error.log  notice;<br \/>\n#error_log  logs\/error.log  info;<\/p>\n<p>events {<br \/>\n#\u5355\u4e2a\u4e1a\u52a1\u8fdb\u7a0b\u53ef\u63a5\u53d7\u8fde\u63a5\u6570<br \/>\n    worker_connections  1024;<br \/>\n}<\/p>\n<p>http {<br \/>\n#\u5f15\u5165http mime\u7c7b\u578b&#xff0c;\u5f15\u5165\u5728conf\u6587\u4ef6\u4e0b\u7684mime.types\u6587\u4ef6,\u8ba9\u6d4f\u89c8\u5668\u77e5\u9053\u8bc6\u522b\u6587\u4ef6\u540e\u7f00\u540d\u540e\u8be5\u5982\u4f55\u5c55\u793a<br \/>\n    include       mime.types;<br \/>\n#\u5982\u679cmime\u7c7b\u578b\u6ca1\u5339\u914d\u4e0a&#xff0c;\u9ed8\u8ba4\u4f7f\u7528\u4e8c\u8fdb\u5236\u6d41\u7684\u65b9\u5f0f\u4f20\u8f93\u3002<br \/>\n    default_type  application\/octet-stream;<\/p>\n<p>#\u4f7f\u7528\u9ad8\u6548\u7f51\u7edc\u4f20\u8f93&#xff0c;\u4e5f\u5c31\u662f\u6570\u636e0\u62f7\u8d1d&#xff0c;\u76f4\u63a5\u4f20\u8f93\u6570\u636e\u3002\u672a\u5f00\u542fsendfile<br \/>\n    sendfile        on;<br \/>\n    #\u4fdd\u6301\u94fe\u63a5\u65f6\u95f4<br \/>\n    keepalive_timeout  65;<\/p>\n<p>#\u8d1f\u8f7d\u5747\u8861\u670d\u52a1\u5668\u5b9a\u4e49<br \/>\nupstream  asd{<br \/>\nserver 192.168.222.131;<br \/>\nserver 192.168.222.132;<br \/>\n}<\/p>\n<p>    #vhost\u865a\u62df\u4e3b\u673a-1<br \/>\n    server {<br \/>\n        #\u76d1\u542c\u7aef\u53e3\u53f7<br \/>\n        listen       80;<br \/>\n        #\u4e3b\u673a\u540d\\\\\u57df\u540d&#xff0c;\u7a7a\u683c\u540e\u9762\u53ef\u4ee5\u518d\u63a5\u4e00\u4e2a\u57df\u540d&#xff0c;\u652f\u6301\u6b63\u5219&#xff0c;\u4e0d\u540c\u57df\u540d\u540e\u7f00\u4e5f\u53ef\u4ee5\u3002<br \/>\n        server_name  www.lingran.website;<br \/>\n        #\u5339\u914d\u8def\u5f84url,\u6837\u4f8b:http:\/\/nginx.org\/en\/download.html<br \/>\n        location \/ {<br \/>\n            #\u6837\u4f8b<br \/>\n            rewrite ^\/([0-9]&#043;).html$ \/index.jsp?pageNum&#061;$1 break;<br \/>\n            proxy_pass http:\/\/asd;<\/p>\n<p>        }<br \/>\n        #~\u8868\u793a\u8981\u4f7f\u7528\u6b63\u5219\u4e86&#xff0c;*\u8868\u793a\u4e0d\u533a\u5206\u5927\u5c0f\u5199&#xff0c;|\u9694\u5f00\u4eca\u5199\u591a\u4e2a<br \/>\n        location ~*\/(css|js|img) {<br \/>\n            #\u8fd9\u4e09\u4e2a\u9759\u6001\u6587\u4ef6\u5939css\u3001js\u3001img&#xff0c;\u8981\u5728\u4e0b\u9762\u7684\u8def\u5f84\u91cc<br \/>\n            root   C:\/Users\/Administrator\/Desktop\/www;<br \/>\n            index  index.html index.htm;<br \/>\n        }<\/p>\n<p>        #\u670d\u52a1\u7aef\u62a5\u9519\u540e\u62a5\u9519\u7f16\u7801\u5bf9\u5e94\u9875\u9762\u3002\u6837\u4f8b:http:\/\/nginx.org\/50x.html<br \/>\n        error_page   500 502 503 504  \/50x.html;<br \/>\n        #\u62a5\u9519\u540e\u8bc6\u522b\u5230\u57df\u540d\u540e\u9762\u8ddf\u4e86\/50x.html&#xff0c;\u5219\u5339\u914d\u5230\u6839\u76ee\u5f55root\u4e0b\u7684html\u6587\u4ef6\u5939<br \/>\n        location &#061; \/50x.html {<br \/>\n            root   html;<br \/>\n        }<br \/>\n    }<\/p>\n<p>}<\/p>\n<h3>3\u3001\u6548\u679c<\/h3>\n<p><img decoding=\"async\" src=\"2025-04-18qcmt5xq5pxe.png\" alt=\"eb70ff311e7d4025b6864bd3c2e02cef.png\" \/><\/p>\n<p><img decoding=\"async\" src=\"2025-04-185oy3aoxslyx.png\" alt=\"12a636d388dc445090be9e5f5d1c0fde.png\" \/><\/p>\n<p>\u00a0<\/p>\n<h2>\u5341\u4e00\u3001\u62a5\u9519<\/h2>\n<h3>1\u3001[error] OpenEvent(&#034;Global\\\\ngx_reload_3220&#034;)<\/h3>\n<p><img decoding=\"async\" src=\"2025-04-18fwpsxtvlvxv.png\" alt=\"6da2bd70946e4a12b06d427e46e3f23b.png\" \/><\/p>\n<p>nginx: [error] OpenEvent(&#034;Global\\\\ngx_reload_3220&#034;) failed (2: The system cannot find the file specified) <\/p>\n<p>\u547d\u4ee4\u7a97\u53e3\u6743\u9650\u4e0d\u8db3&#xff0c;\u4ee5\u7ba1\u7406\u5458\u6743\u9650\u6253\u5f00\u547d\u4ee4\u7a97\u53e3\u6267\u884c\u5373\u53ef<\/p>\n<p>\u00a0<\/p>\n<p>\u76ee\u524d\u8fd9\u5230\u8fd9\u4e86<\/p>\n<p>\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.7w\u6b21\uff0c\u70b9\u8d5e53\u6b21\uff0c\u6536\u85cf129\u6b21\u3002Windows \u670d\u52a1\u5668Nginx \u4e0b\u8f7d\u3001\u90e8\u7f72\u3001\u5e94\u7528\u5168\u6d41\u7a0b\uff08\u56fe\u6587\u8be6\u7ec6\u6559\u7a0b\uff09_nginx\u4e0b\u8f7d<\/p>\n","protected":false},"author":2,"featured_media":10968,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[117,149,43,44],"topic":[],"class_list":["post-10988","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-nginx","tag-windows","tag-43","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Windows \u670d\u52a1\u5668Nginx \u4e0b\u8f7d\u3001\u90e8\u7f72\u3001\u914d\u7f6e\u6d41\u7a0b\uff08\u56fe\u6587\u6559\u7a0b\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/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.wsisp.com\/helps\/10988.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Windows \u670d\u52a1\u5668Nginx \u4e0b\u8f7d\u3001\u90e8\u7f72\u3001\u914d\u7f6e\u6d41\u7a0b\uff08\u56fe\u6587\u6559\u7a0b\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.7w\u6b21\uff0c\u70b9\u8d5e53\u6b21\uff0c\u6536\u85cf129\u6b21\u3002Windows \u670d\u52a1\u5668Nginx \u4e0b\u8f7d\u3001\u90e8\u7f72\u3001\u5e94\u7528\u5168\u6d41\u7a0b\uff08\u56fe\u6587\u8be6\u7ec6\u6559\u7a0b\uff09_nginx\u4e0b\u8f7d\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/10988.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-18T10:23:20+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102308-6802280c0881d.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/10988.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/10988.html\",\"name\":\"Windows \u670d\u52a1\u5668Nginx \u4e0b\u8f7d\u3001\u90e8\u7f72\u3001\u914d\u7f6e\u6d41\u7a0b\uff08\u56fe\u6587\u6559\u7a0b\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-18T10:23:20+00:00\",\"dateModified\":\"2025-04-18T10:23:20+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/10988.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/10988.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/10988.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Windows \u670d\u52a1\u5668Nginx \u4e0b\u8f7d\u3001\u90e8\u7f72\u3001\u914d\u7f6e\u6d41\u7a0b\uff08\u56fe\u6587\u6559\u7a0b\uff09\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Windows \u670d\u52a1\u5668Nginx \u4e0b\u8f7d\u3001\u90e8\u7f72\u3001\u914d\u7f6e\u6d41\u7a0b\uff08\u56fe\u6587\u6559\u7a0b\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","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.wsisp.com\/helps\/10988.html","og_locale":"zh_CN","og_type":"article","og_title":"Windows \u670d\u52a1\u5668Nginx \u4e0b\u8f7d\u3001\u90e8\u7f72\u3001\u914d\u7f6e\u6d41\u7a0b\uff08\u56fe\u6587\u6559\u7a0b\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.7w\u6b21\uff0c\u70b9\u8d5e53\u6b21\uff0c\u6536\u85cf129\u6b21\u3002Windows \u670d\u52a1\u5668Nginx \u4e0b\u8f7d\u3001\u90e8\u7f72\u3001\u5e94\u7528\u5168\u6d41\u7a0b\uff08\u56fe\u6587\u8be6\u7ec6\u6559\u7a0b\uff09_nginx\u4e0b\u8f7d","og_url":"https:\/\/www.wsisp.com\/helps\/10988.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-18T10:23:20+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102308-6802280c0881d.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"11 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/10988.html","url":"https:\/\/www.wsisp.com\/helps\/10988.html","name":"Windows \u670d\u52a1\u5668Nginx \u4e0b\u8f7d\u3001\u90e8\u7f72\u3001\u914d\u7f6e\u6d41\u7a0b\uff08\u56fe\u6587\u6559\u7a0b\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-18T10:23:20+00:00","dateModified":"2025-04-18T10:23:20+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/10988.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/10988.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/10988.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Windows \u670d\u52a1\u5668Nginx \u4e0b\u8f7d\u3001\u90e8\u7f72\u3001\u914d\u7f6e\u6d41\u7a0b\uff08\u56fe\u6587\u6559\u7a0b\uff09"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/10988","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=10988"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/10988\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/10968"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=10988"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=10988"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=10988"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=10988"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}