{"id":696,"date":"2022-07-28T11:08:52","date_gmt":"2022-07-28T03:08:52","guid":{"rendered":"https:\/\/www.qiangzhenshuai.com\/?p=696"},"modified":"2022-09-21T20:40:52","modified_gmt":"2022-09-21T12:40:52","slug":"nginx-nginx%e4%bb%8b%e7%bb%8d","status":"publish","type":"post","link":"https:\/\/www.qiangzhenshuai.com\/?p=696","title":{"rendered":"NGINX-web\u670d\u52a1"},"content":{"rendered":"<p><!--more--><\/p>\n<h1>1.nginx\u662f\u4ec0\u4e48<\/h1>\n<p>Nginx\u662f\u4fc4\u7f57\u65af\u4eba\u7f16\u5199\u7684\u5341\u5206\u8f7b\u91cf\u7ea7\u7684HTTP\u670d\u52a1\u5668,Nginx\uff0c\u5b83\u7684\u53d1\u97f3\u4e3a\u201cengine X\u201d\uff0c\u662f\u4e00\u4e2a\u9ad8\u6027\u80fd\u7684HTTP\u548c\u53cd\u5411\u4ee3\u7406\u670d\u52a1\u5668\uff0c\u540c\u65f6\u4e5f\u662f\u4e00\u4e2aIMAP\/POP3\/SMTP \u4ee3\u7406\u670d\u52a1\u5668\u3002Nginx\u662f\u7531\u4fc4\u7f57\u65af\u4eba Igor Sysoev\u4e3a\u4fc4\u7f57\u65af\u8bbf\u95ee\u91cf\u7b2c\u4e8c\u7684 Rambler.ru\u7ad9\u70b9\u5f00\u53d1\u7684\uff0c\u5b83\u5df2\u7ecf\u5728\u8be5\u7ad9\u70b9\u8fd0\u884c\u8d85\u8fc7\u4e24\u5e74\u534a\u4e86\u3002Igor Sysoev\u5728\u5efa\u7acb\u7684\u9879\u76ee\u65f6,\u4f7f\u7528\u57fa\u4e8eBSD\u8bb8\u53ef\u3002<\/p>\n<p>\u82f1\u6587\u4e3b\u9875\uff1a<a href=\"http:\/\/nginx.net\/\" target=\"_blank\" rel=\"noopener\">http:\/\/nginx.net<\/a><\/p>\n<p>\u52302013\u5e74\uff0c\u76ee\u524d\u6709\u5f88\u591a\u56fd\u5185\u7f51\u7ad9\u91c7\u7528Nginx\u4f5c\u4e3aWeb\u670d\u52a1\u5668\uff0c\u5982\u56fd\u5185\u77e5\u540d\u7684\u65b0\u6d6a\u3001163\u3001\u817e\u8baf\u3001Discuz\u3001\u8c46\u74e3\u7b49\u3002\u636enetcraft\u7edf\u8ba1\uff0cNginx\u6392\u540d\u7b2c3\uff0c\u7ea6\u536015%\u7684\u4efd\u989d(\u53c2\u89c1\uff1a<a href=\"http:\/\/news.netcraft.com\/archives\/category\/web-server-survey\/\" target=\"_blank\" rel=\"noopener\">http:\/\/news.netcraft.com\/archives\/category\/web-server-survey\/<\/a>\u00a0)<\/p>\n<p>Nginx\u4ee5\u4e8b\u4ef6\u9a71\u52a8\u7684\u65b9\u5f0f\u7f16\u5199\uff0c\u6240\u4ee5\u6709\u975e\u5e38\u597d\u7684\u6027\u80fd\uff0c\u540c\u65f6\u4e5f\u662f\u4e00\u4e2a\u975e\u5e38\u9ad8\u6548\u7684\u53cd\u5411\u4ee3\u7406\u3001\u8d1f\u8f7d\u5e73\u8861\u3002\u5176\u62e5\u6709\u5339\u914dLighttpd\u7684\u6027\u80fd\uff0c\u540c\u65f6\u8fd8\u6ca1\u6709Lighttpd\u7684\u5185\u5b58\u6cc4\u6f0f\u95ee\u9898\uff0c\u800c\u4e14Lighttpd\u7684mod_proxy\u4e5f\u6709\u4e00\u4e9b\u95ee\u9898\u5e76\u4e14\u5f88\u4e45\u6ca1\u6709\u66f4\u65b0\u3002<\/p>\n<p>\u73b0\u5728\uff0cIgor\u5c06\u6e90\u4ee3\u7801\u4ee5\u7c7bBSD\u8bb8\u53ef\u8bc1\u7684\u5f62\u5f0f\u53d1\u5e03\u3002Nginx\u56e0\u4e3a\u5b83\u7684\u7a33\u5b9a\u6027\u3001\u4e30\u5bcc\u7684\u6a21\u5757\u5e93\u3001\u7075\u6d3b\u7684\u914d\u7f6e\u548c\u4f4e\u7cfb\u7edf\u8d44\u6e90\u7684\u6d88\u8017\u800c\u95fb\u540d\uff0e\u4e1a\u754c\u4e00\u81f4\u8ba4\u4e3a\u5b83\u662fApache2.2\uff0bmod_proxy_balancer\u7684\u8f7b\u91cf\u7ea7\u4ee3\u66ff\u8005\uff0c\u4e0d\u4ec5\u662f\u56e0\u4e3a\u54cd\u5e94\u9759\u6001\u9875\u9762\u7684\u901f\u5ea6\u975e\u5e38\u5feb\uff0c\u800c\u4e14\u5b83\u7684\u6a21\u5757\u6570\u91cf\u8fbe\u5230Apache\u7684\u8fd12\/3\u3002\u5bf9proxy\u548crewrite\u6a21\u5757\u7684\u652f\u6301\u5f88\u5f7b\u5e95\uff0c\u8fd8\u652f\u6301mod_fcgi\u3001ssl\u3001vhosts \uff0c\u9002\u5408\u7528\u6765\u505amongrel clusters\u7684\u524d\u7aefHTTP\u54cd\u5e94<\/p>\n<p>\u73b0\u5728\uff0cIgor\u5c06\u6e90\u4ee3\u7801\u4ee5\u7c7bBSD\u8bb8\u53ef\u8bc1\u7684\u5f62\u5f0f\u53d1\u5e03\u3002Nginx\u56e0\u4e3a\u5b83\u7684\u7a33\u5b9a\u6027\u3001\u4e30\u5bcc\u7684\u6a21\u5757\u5e93\u3001\u7075\u6d3b\u7684\u914d\u7f6e\u548c\u4f4e\u7cfb\u7edf\u8d44\u6e90\u7684\u6d88\u8017\u800c\u95fb\u540d\uff0e\u4e1a\u754c\u4e00\u81f4\u8ba4\u4e3a\u5b83\u662fApache2.2\uff0bmod_proxy_balancer\u7684\u8f7b\u91cf\u7ea7\u4ee3\u66ff\u8005\uff0c\u4e0d\u4ec5\u662f\u56e0\u4e3a\u54cd\u5e94\u9759\u6001\u9875\u9762\u7684\u901f\u5ea6\u975e\u5e38\u5feb\uff0c\u800c\u4e14\u5b83\u7684\u6a21\u5757\u6570\u91cf\u8fbe\u5230Apache\u7684\u8fd12\/3\u3002\u5bf9proxy\u548crewrite\u6a21\u5757\u7684\u652f\u6301\u5f88\u5f7b\u5e95\uff0c\u8fd8\u652f\u6301mod_fcgi\u3001ssl\u3001vhosts \uff0c\u9002\u5408\u7528\u6765\u505amongrel clusters\u7684\u524d\u7aefHTTP\u54cd\u5e94\u3002<\/p>\n<p>nginx\u505a\u4e3aHTTP\u670d\u52a1\u5668\uff0c\u6709\u4ee5\u4e0b\u51e0\u9879\u57fa\u672c\u7279\u6027\uff1a<\/p>\n<p>\u5904\u7406\u9759\u6001\u6587\u4ef6\uff0c\u7d22\u5f15\u6587\u4ef6\u4ee5\u53ca\u81ea\u52a8\u7d22\u5f15\uff1b\u6253\u5f00\u6587\u4ef6\u63cf\u8ff0\u7b26\u7f13\u51b2\uff0e<\/p>\n<p>\u65e0\u7f13\u5b58\u7684\u53cd\u5411\u4ee3\u7406\u52a0\u901f\uff0c\u7b80\u5355\u7684\u8d1f\u8f7d\u5747\u8861\u548c\u5bb9\u9519\uff0e<\/p>\n<p>FastCGI\uff0c\u7b80\u5355\u7684\u8d1f\u8f7d\u5747\u8861\u548c\u5bb9\u9519\uff0e<\/p>\n<p>\u6a21\u5757\u5316\u7684\u7ed3\u6784\u3002\u5305\u62ecgzipping, byte ranges, chunked responses,\u4ee5\u53ca SSI-filter\u7b49filter\u3002\u5982\u679c\u7531FastCGI\u6216\u5176\u5b83\u4ee3\u7406\u670d\u52a1\u5668\u5904\u7406\u5355\u9875\u4e2d\u5b58\u5728\u7684\u591a\u4e2aSSI\uff0c\u5219\u8fd9\u9879\u5904\u7406\u53ef\u4ee5\u5e76\u884c\u8fd0\u884c\uff0c\u800c\u4e0d\u9700\u8981\u76f8\u4e92\u7b49\u5f85\u3002<\/p>\n<p>\u652f\u6301SSL \u548c TLSSNI\uff0e<\/p>\n<p>Nginx\u4e13\u4e3a\u6027\u80fd\u4f18\u5316\u800c\u5f00\u53d1\uff0c\u6027\u80fd\u662f\u5176\u6700\u91cd\u8981\u7684\u8003\u91cf,\u5b9e\u73b0\u4e0a\u975e\u5e38\u6ce8\u91cd\u6548\u7387 \u3002\u5b83\u652f\u6301\u5185\u6838Poll\u6a21\u578b\uff0c\u80fd\u7ecf\u53d7\u9ad8\u8d1f\u8f7d\u7684\u8003\u9a8c,\u6709\u62a5\u544a\u8868\u660e\u80fd\u652f\u6301\u9ad8\u8fbe 50,000\u4e2a\u5e76\u53d1\u8fde\u63a5\u6570\u3002<\/p>\n<p>Nginx\u5177\u6709\u5f88\u9ad8\u7684\u7a33\u5b9a\u6027\u3002\u5176\u5b83HTTP\u670d\u52a1\u5668\uff0c\u5f53\u9047\u5230\u8bbf\u95ee\u7684\u5cf0\u503c\uff0c\u6216\u8005\u6709\u4eba\u6076\u610f\u53d1\u8d77\u6162\u901f\u8fde\u63a5\u65f6\uff0c\u4e5f\u5f88\u53ef\u80fd\u4f1a\u5bfc\u81f4\u670d\u52a1\u5668\u7269\u7406\u5185\u5b58\u8017\u5c3d\u9891\u7e41\u4ea4\u6362\uff0c\u5931\u53bb\u54cd\u5e94\uff0c\u53ea\u80fd\u91cd\u542f\u670d\u52a1\u5668\u3002\u4f8b\u5982\u5f53\u524dapache\u4e00\u65e6\u4e0a\u5230200\u4e2a\u4ee5\u4e0a\u8fdb\u7a0b\uff0cweb\u54cd\u5e94\u901f\u5ea6\u5c31\u660e\u663e\u975e\u5e38\u7f13\u6162\u4e86\u3002\u800cNginx\u91c7\u53d6\u4e86\u5206\u9636\u6bb5\u8d44\u6e90\u5206\u914d\u6280\u672f\uff0c\u4f7f\u5f97\u5b83\u7684CPU\u4e0e\u5185\u5b58\u5360\u7528\u7387\u975e\u5e38\u4f4e\u3002nginx\u5b98\u65b9\u8868\u793a\u4fdd\u630110,000\u4e2a\u6ca1\u6709\u6d3b\u52a8\u7684\u8fde\u63a5\uff0c\u5b83\u53ea\u53602.5M\u5185\u5b58\uff0c\u6240\u4ee5\u7c7b\u4f3cDOS\u8fd9\u6837\u7684\u653b\u51fb\u5bf9nginx\u6765\u8bf4\u57fa\u672c\u4e0a\u662f\u6beb\u65e0\u7528\u5904\u7684\u3002\u5c31\u7a33\u5b9a\u6027\u800c\u8a00,nginx\u6bd4lighthttpd\u66f4\u80dc\u4e00\u7b79\u3002<\/p>\n<p>Nginx\u652f\u6301\u70ed\u90e8\u7f72\u3002\u5b83\u7684\u542f\u52a8\u7279\u522b\u5bb9\u6613, \u5e76\u4e14\u51e0\u4e4e\u53ef\u4ee5\u505a\u52307*24\u4e0d\u95f4\u65ad\u8fd0\u884c\uff0c\u5373\u4f7f\u8fd0\u884c\u6570\u4e2a\u6708\u4e5f\u4e0d\u9700\u8981\u91cd\u65b0\u542f\u52a8\u3002\u4f60\u8fd8\u80fd\u591f\u5728\u4e0d\u95f4\u65ad\u670d\u52a1\u7684\u60c5\u51b5\u4e0b\uff0c\u5bf9\u8f6f\u4ef6\u7248\u672c\u8fdb\u884c\u8fdb\u884c\u5347\u7ea7\u3002<\/p>\n<p>Nginx\u91c7\u7528master-slave\u6a21\u578b,\u80fd\u591f\u5145\u5206\u5229\u7528SMP\u7684\u4f18\u52bf\uff0c\u4e14\u80fd\u591f\u51cf\u5c11\u5de5\u4f5c\u8fdb\u7a0b\u5728\u78c1\u76d8I\/O\u7684\u963b\u585e\u5ef6\u8fdf\u3002\u5f53\u91c7\u7528select()\/poll()\u8c03\u7528\u65f6\uff0c\u8fd8\u53ef\u4ee5\u9650\u5236\u6bcf\u4e2a\u8fdb\u7a0b\u7684\u8fde\u63a5\u6570\u3002<\/p>\n<p>Nginx\u4ee3\u7801\u8d28\u91cf\u975e\u5e38\u9ad8\uff0c\u4ee3\u7801\u5f88\u89c4\u8303\uff0c\u624b\u6cd5\u6210\u719f\uff0c \u6a21\u5757\u6269\u5c55\u4e5f\u5f88\u5bb9\u6613\u3002\u7279\u522b\u503c\u5f97\u4e00\u63d0\u7684\u662f\u5f3a\u5927\u7684Upstream\u4e0eFilter\u94fe\u3002Upstream\u4e3a\u8bf8\u5982reverse proxy,\u4e0e\u5176\u4ed6\u670d\u52a1\u5668\u901a\u4fe1\u6a21\u5757\u7684\u7f16\u5199\u5960\u5b9a\u4e86\u5f88\u597d\u7684\u57fa\u7840\u3002\u800cFilter\u94fe\u6700\u9177\u7684\u90e8\u5206\u5c31\u662f\u5404\u4e2afilter\u4e0d\u5fc5\u7b49\u5f85\u524d\u4e00\u4e2afilter\u6267\u884c\u5b8c\u6bd5\u3002\u5b83\u53ef\u4ee5\u628a\u524d\u4e00\u4e2afilter\u7684\u8f93\u51fa\u505a\u4e3a\u5f53\u524dfilter\u7684\u8f93\u5165\uff0c\u8fd9\u6709\u70b9\u50cfUnix\u7684\u7ba1\u7ebf\u3002\u8fd9\u610f\u5473\u7740\uff0c\u4e00\u4e2a\u6a21\u5757\u53ef\u4ee5\u5f00\u59cb\u538b\u7f29\u4ece\u540e\u7aef\u670d\u52a1\u5668\u53d1\u9001\u8fc7\u6765\u7684\u8bf7\u6c42\uff0c\u4e14\u53ef\u4ee5\u5728\u6a21\u5757\u63a5\u6536\u5b8c\u540e\u7aef\u670d\u52a1\u5668\u7684\u6574\u4e2a\u8bf7\u6c42\u4e4b\u524d\u628a\u538b\u7f29\u6d41\u8f6c\u5411\u5ba2\u6237\u7aef\u3002<\/p>\n<p>Nginx\u91c7\u7528\u4e86\u4e00\u4e9bos\u63d0\u4f9b\u7684\u6700\u65b0\u7279\u6027\u5982\u5bf9sendfile (Linux2.2+)\uff0caccept-filter (FreeBSD4.1+)\uff0cTCP_DEFER_ACCEPT (Linux 2.4+)\u7684\u652f\u6301\uff0c\u4ece\u800c\u5927\u5927\u63d0\u9ad8\u4e86\u6027\u80fd\u3002<\/p>\n<p>\u5f53\u7136\uff0cnginx\u8fd8\u5f88\u5e74\u8f7b\uff0c\u591a\u591a\u5c11\u5c11\u5b58\u5728\u4e00\u4e9b\u95ee\u9898\uff0c\u6bd4\u5982\uff1aNginx\u662f\u4fc4\u7f57\u65af\u4eba\u521b\u5efa\uff0c\u867d\u7136\u524d\u51e0\u5e74\u6587\u6863\u6bd4\u8f83\u5c11\uff0c\u4f46\u662f\u76ee\u524d\u6587\u6863\u65b9\u9762\u6bd4\u8f83\u5168\u9762\uff0c\u82f1\u6587\u8d44\u6599\u5c45\u591a\uff0c\u4e2d\u6587\u7684\u8d44\u6599\u4e5f\u6bd4\u8f83\u591a\uff0c\u800c\u4e14\u6709\u4e13\u95e8\u7684\u4e66\u7c4d\u548c\u8d44\u6599\u53ef\u4f9b\u67e5\u627e\u3002<\/p>\n<p>nginx\u7684\u4f5c\u8005\u548c\u793e\u533a\u90fd\u5728\u4e0d\u65ad\u7684\u52aa\u529b\u5b8c\u5584\uff0c\u6211\u4eec\u6709\u7406\u7531\u76f8\u4fe1nginx\u5c06\u7ee7\u7eed\u4ee5\u9ad8\u901f\u7684\u589e\u957f\u7387\u6765\u5206\u4eab\u8f7b\u91cf\u7ea7HTTP\u670d\u52a1\u5668\u5e02\u573a\uff0c\u4f1a\u6709\u4e00\u4e2a\u66f4\u7f8e\u597d\u7684\u672a\u6765<\/p>\n<h1>2.nginx\u529f\u80fd<\/h1>\n<h2>\u53cd\u5411\u4ee3\u7406\u548c\u6b63\u5411\u4ee3\u7406<\/h2>\n<h3 data-pid=\"uv9hfqSE\">\u6b63\u5411\u4ee3\u7406<\/h3>\n<p>\u7b80\u5355\u7684\u8bf4,\u6211\u662f\u4e00\u4e2a\u7528\u6237,\u6211\u65e0\u6cd5\u76f4\u63a5\u8bbf\u95ee\u4e00\u4e2a\u7f51\u7ad9,\u4f46\u662f\u6211\u80fd\u8bbf\u95ee\u4e00\u4e2a\u4ee3\u7406\u670d\u52a1\u5668,\u8fd9\u4e2a\u4ee3\u7406\u670d\u52a1\u5668\u80fd\u8bbf\u95ee\u90a3\u4e2a\u6211\u4e0d\u80fd\u8bbf\u95ee\u7684\u7f51\u7ad9,\u4e8e\u662f\u6211\u5148\u8fde\u4e0a\u4ee3\u7406\u670d\u52a1\u5668,\u544a\u8bc9\u5b83\u6211\u9700\u8981\u90a3\u4e2a\u65e0\u6cd5\u8bbf\u95ee\u7f51\u7ad9\u7684\u5185\u5bb9,\u4ee3\u7406\u670d\u52a1\u5668\u53bb\u53d6\u56de\u6765,\u7136\u540e\u8fd4\u56de\u7ed9\u6211\u3002\u4ece\u7f51\u7ad9\u7684\u89d2\u5ea6,\u53ea\u5728\u4ee3\u7406\u670d\u52a1\u5668\u6765\u53d6\u5185\u5bb9\u7684\u65f6\u5019\u6709\u4e00\u6b21\u8bb0\u5f55\u3002<\/p>\n<p>\u7ed3\u8bba\u5c31\u662f\uff0c\u6b63\u5411\u4ee3\u7406\uff0c\u662f\u4e00\u4e2a\u4f4d\u4e8e\u5ba2\u6237\u7aef\u548c\u539f\u59cb\u670d\u52a1\u5668(origin server)\u4e4b\u95f4\u7684\u670d\u52a1\u5668\uff0c\u4e3a\u4e86\u4ece\u539f\u59cb\u670d\u52a1\u5668\u53d6\u5f97\u5185\u5bb9\uff0c\u5ba2\u6237\u7aef\u5411\u4ee3\u7406\u53d1\u9001\u4e00\u4e2a\u8bf7\u6c42\u5e76\u6307\u5b9a\u76ee\u6807(\u539f\u59cb\u670d\u52a1\u5668)\uff0c\u7136\u540e\u4ee3\u7406\u5411\u539f\u59cb\u670d\u52a1\u5668\u8f6c\u4ea4\u8bf7\u6c42\u5e76\u5c06\u83b7\u5f97\u7684\u5185\u5bb9\u8fd4\u56de\u7ed9\u5ba2\u6237\u7aef\u3002\u5ba2\u6237\u7aef\u5fc5\u987b\u8981\u8fdb\u884c\u4e00\u4e9b\u7279\u522b\u7684\u8bbe\u7f6e\u624d\u80fd\u4f7f\u7528\u6b63\u5411\u4ee3\u7406<\/p>\n<h3 data-pid=\"Z0uvQWZY\">\u53cd\u5411\u4ee3\u7406<\/h3>\n<p data-pid=\"KcWfpPpR\">\u4f8b\u5982\u6211\u8981\u8bbf\u95ee localhost:8080\/views\/test1 \u8fd9\u4e2a\u9875\u9762\uff0c\u4f46view\u5bf9\u5e94\u7684\u670d\u52a1\u5668\u4e0a\u5e76\u6ca1\u6709test1\u8fd9\u4e2a\u8d44\u6e90\uff0c\u5b83\u662f\u4ece\u53e6\u4e00\u53f0\u670d\u52a1\u5668\u4e0a\u8c03\u7528\u7684\u8d44\u6e90\u3002\u8fd9\u6837view\u5bf9\u5e94\u7684\u90a3\u4e2a\u670d\u52a1\u5668\u5c31\u4f7f\u7528\u4e86\u53cd\u5411\u4ee3\u7406\u3002\u5373\u7528\u6237\u53ea\u9700\u8981\u628a\u8bf7\u6c42\u53d1\u7ed9\u7279\u5b9a\u7684\u53cd\u5411\u4ee3\u7406\u670d\u52a1\u5668\uff0c\u5177\u4f53\u8bf7\u6c42\u662f\u8c01\u5904\u7406\u7684\u7528\u6237\u4e0d\u9700\u8981\u77e5\u9053(\u5176\u5b9e\u4e5f\u4e0d\u77e5\u9053)\uff0c\u7531\u4ee3\u7406\u670d\u52a1\u5668\u7edf\u4e00\u5904\u7406\u3002<\/p>\n<p data-pid=\"VhbiQufV\">\u7ed3\u8bba\u5c31\u662f\u53cd\u5411\u4ee3\u7406\u6b63\u597d\u76f8\u53cd\uff0c\u5bf9\u4e8e\u5ba2\u6237\u7aef\u800c\u8a00\u5b83\u5c31\u50cf\u662f\u539f\u59cb\u670d\u52a1\u5668\uff0c\u5e76\u4e14\u5ba2\u6237\u7aef\u4e0d\u9700\u8981\u8fdb\u884c\u4efb\u4f55\u7279\u522b\u7684\u8bbe\u7f6e\u3002\u5ba2\u6237\u7aef\u5411\u53cd\u5411\u4ee3\u7406\u7684\u547d\u540d\u7a7a\u95f4(name-space)\u4e2d\u7684\u5185\u5bb9\u53d1\u9001\u666e\u901a\u8bf7\u6c42\uff0c\u63a5\u7740\u53cd\u5411\u4ee3\u7406\u5c06\u5224\u65ad\u5411\u4f55\u5904(\u539f\u59cb\u670d\u52a1\u5668)\u8f6c\u4ea4\u8bf7\u6c42\uff0c\u5e76\u5c06\u83b7\u5f97\u7684\u5185\u5bb9\u8fd4\u56de\u7ed9\u5ba2\u6237\u7aef\uff0c\u5c31\u50cf\u8fd9\u4e9b\u5185\u5bb9 \u539f\u672c\u5c31\u662f\u5b83\u81ea\u5df1\u7684\u4e00\u6837\u3002\u6b63\u5411\u4ee3\u7406\u7684\u5178\u578b\u7528\u9014\u662f\u4e3a\u5728\u9632\u706b\u5899\u5185\u7684\u5c40\u57df\u7f51\u5ba2\u6237\u7aef\u63d0\u4f9b\u8bbf\u95eeInternet\u7684\u9014\u5f84\u3002<\/p>\n<p data-pid=\"uCMuzuaG\">\u6b63\u5411\u4ee3\u7406\u8fd8\u53ef\u4ee5\u4f7f\u7528\u7f13\u51b2\u7279\u6027\u51cf\u5c11\u7f51\u7edc\u4f7f\u7528\u7387\u3002\u53cd\u5411\u4ee3\u7406\u7684\u5178\u578b\u7528\u9014\u662f\u5c06 \u9632\u706b\u5899\u540e\u9762\u7684\u670d\u52a1\u5668\u63d0\u4f9b\u7ed9Internet\u7528\u6237\u8bbf\u95ee\u3002\u53cd\u5411\u4ee3\u7406\u8fd8\u53ef\u4ee5\u4e3a\u540e\u7aef\u7684\u591a\u53f0\u670d\u52a1\u5668\u63d0\u4f9b\u8d1f\u8f7d\u5e73\u8861\uff0c\u6216\u4e3a\u540e\u7aef\u8f83\u6162\u7684\u670d\u52a1\u5668\u63d0\u4f9b\u7f13\u51b2\u670d\u52a1\u3002<\/p>\n<h3 data-pid=\"SgmRQUSz\">\u603b\u7ed3<\/h3>\n<p>\u6b63\u5411\u4ee3\u7406\uff1a\u9488\u5bf9\u5ba2\u6237\u7aef\u800c\u8a00\uff0c \u4ee3\u7406\u670d\u52a1\u5668\u4ee3\u7406\u5ba2\u6237\u7aef\uff0c\u8f6c\u53d1\u8bf7\u6c42\uff0c\u5e76\u5c06\u83b7\u5f97\u7684\u5185\u5bb9\u8fd4\u56de\u7ed9\u5ba2\u6237\u7aef\u3002<\/p>\n<p>\u53cd\u5411\u4ee3\u7406\uff1a\u9488\u5bf9\u5ba2\u6237\u7aef\u800c\u8a00\uff0c \u4ee3\u7406\u670d\u52a1\u5668\u5c31\u50cf\u662f\u539f\u59cb\u670d\u52a1\u5668,\u4ee3\u7406\u96c6\u7fa4\u7684web\u8282\u70b9\u670d\u52a1\u5668\u8fd4\u56de\u7ed3\u679c<\/p>\n<h2 data-pid=\"7CXuiXq4\">\u8d1f\u8f7d\u5747\u8861<\/h2>\n<p>\u8d1f\u8f7d\u5747\u8861\u4e5f\u662fNginx\u5e38\u7528\u7684\u4e00\u4e2a\u529f\u80fd\uff0c\u8d1f\u8f7d\u5747\u8861\u5176\u610f\u601d\u5c31\u662f\u5206\u644a\u5230\u591a\u4e2a\u64cd\u4f5c\u5355\u5143\u4e0a\u8fdb\u884c\u6267\u884c\uff0c\u4f8b\u5982Web\u670d\u52a1\u5668\u3001FTP\u670d\u52a1\u5668\u3001\u4f01\u4e1a\u5173\u952e\u5e94\u7528\u670d\u52a1\u5668\u548c\u5176\u5b83\u5173\u952e\u4efb\u52a1\u670d\u52a1\u5668\u7b49\uff0c\u4ece\u800c\u5171\u540c\u5b8c\u6210\u5de5\u4f5c\u4efb\u52a1\u3002<\/p>\n<p>\u7b80\u5355\u800c\u8a00\u5c31\u662f\u5f53\u67092\u53f0\u6216\u4ee5\u4e0a\u670d\u52a1\u5668\u65f6\uff0c\u6839\u636e\u89c4\u5219\u968f\u673a\u7684\u5c06\u8bf7\u6c42\u5206\u53d1\u5230\u6307\u5b9a\u7684\u670d\u52a1\u5668\u4e0a\u5904\u7406\uff0c\u8d1f\u8f7d\u5747\u8861\u914d\u7f6e\u4e00\u822c\u90fd\u9700\u8981\u540c\u65f6\u914d\u7f6e\u53cd\u5411\u4ee3\u7406\uff0c\u901a\u8fc7\u53cd\u5411\u4ee3\u7406\u8df3\u8f6c\u5230\u8d1f\u8f7d\u5747\u8861\u3002\u800cNginx\u76ee\u524d\u652f\u6301\u81ea\u5e263\u79cd\u8d1f\u8f7d\u5747\u8861\u7b56\u7565\uff0c\u8fd8\u67092\u79cd\u5e38\u7528\u7684\u7b2c\u4e09\u65b9\u7b56\u7565<\/p>\n<h3 data-pid=\"Rh7P7q5x\">RR<\/h3>\n<p>\u6309\u7167\u8f6e\u8be2\uff08\u9ed8\u8ba4\uff09\u65b9\u5f0f\u8fdb\u884c\u8d1f\u8f7d\uff0c\u6bcf\u4e2a\u8bf7\u6c42\u6309\u65f6\u95f4\u987a\u5e8f\u9010\u4e00\u5206\u914d\u5230\u4e0d\u540c\u7684\u540e\u7aef\u670d\u52a1\u5668\uff0c\u5982\u679c\u540e\u7aef\u670d\u52a1\u5668down\u6389\uff0c\u80fd\u81ea\u52a8\u5254\u9664\u3002\u867d\u7136\u8fd9\u79cd\u65b9\u5f0f\u7b80\u4fbf\u3001\u6210\u672c\u4f4e\u5ec9\u3002\u4f46\u7f3a\u70b9\u662f\uff1a\u53ef\u9760\u6027\u4f4e\u548c\u8d1f\u8f7d\u5206\u914d\u4e0d\u5747\u8861<\/p>\n<h3 data-pid=\"M_9c33UR\">\u6743\u91cd<\/h3>\n<p>\u6307\u5b9a\u8f6e\u8be2\u51e0\u7387\uff0cweight\u548c\u8bbf\u95ee\u6bd4\u7387\u6210\u6b63\u6bd4\uff0c\u7528\u4e8e\u540e\u7aef\u670d\u52a1\u5668\u6027\u80fd\u4e0d\u5747\u7684\u60c5\u51b5\u3002<\/p>\n<div>\n<pre>upstream test{\r\n     server localhost:8080 weight=9;\r\n     server localhost:8081 weight=1;\r\n     }<\/pre>\n<\/div>\n<p data-pid=\"mKTzsAYi\">\u6b64\u65f68080\u548c8081\u5206\u522b\u536090%\u548c10%\u3002<\/p>\n<h3 data-pid=\"1FIEMnqa\">ip_hash<\/h3>\n<p>\u4e0a\u9762\u76842\u79cd\u65b9\u5f0f\u90fd\u6709\u4e00\u4e2a\u95ee\u9898\uff0c\u90a3\u5c31\u662f\u4e0b\u4e00\u4e2a\u8bf7\u6c42\u6765\u7684\u65f6\u5019\u8bf7\u6c42\u53ef\u80fd\u5206\u53d1\u5230\u53e6\u5916\u4e00\u4e2a\u670d\u52a1\u5668\uff0c\u5f53\u6211\u4eec\u7684\u7a0b\u5e8f\u4e0d\u662f\u65e0\u72b6\u6001\u7684\u65f6\u5019\uff08\u91c7\u7528\u4e86session\u4fdd\u5b58\u6570\u636e\uff09\uff0c\u8fd9\u65f6\u5019\u5c31\u6709\u4e00\u4e2a\u5f88\u5927\u7684\u5f88\u95ee\u9898\u4e86\uff0c\u6bd4\u5982\u628a\u767b\u5f55\u4fe1\u606f\u4fdd\u5b58\u5230\u4e86session\u4e2d\uff0c\u90a3\u4e48\u8df3\u8f6c\u5230\u53e6\u5916\u4e00\u53f0\u670d\u52a1\u5668\u7684\u65f6\u5019\u5c31\u9700\u8981\u91cd\u65b0\u767b\u5f55\u4e86\uff0c\u6240\u4ee5\u5f88\u591a\u65f6\u5019\u6211\u4eec\u9700\u8981\u4e00\u4e2a\u5ba2\u6237\u53ea\u8bbf\u95ee\u4e00\u4e2a\u670d\u52a1\u5668\uff0c\u90a3\u4e48\u5c31\u9700\u8981\u7528iphash\u4e86\uff0ciphash\u7684\u6bcf\u4e2a\u8bf7\u6c42\u6309\u8bbf\u95eeip\u7684hash\u7ed3\u679c\u5206\u914d\uff0c\u8fd9\u6837\u6bcf\u4e2a\u8bbf\u5ba2\u56fa\u5b9a\u8bbf\u95ee\u4e00\u4e2a\u540e\u7aef\u670d\u52a1\u5668\uff0c\u53ef\u4ee5\u89e3\u51b3session\u7684\u95ee\u9898<\/p>\n<div>\n<pre>upstream test {\r\n    ip_hash;\r\n    erver localhost:8080;\r\n    server localhost:8081;\r\n}<\/pre>\n<\/div>\n<h3 data-pid=\"BcJQqBGc\">fair(\u7b2c\u4e09\u65b9)<\/h3>\n<p data-pid=\"qy-36GtV\">\u6309\u540e\u7aef\u670d\u52a1\u5668\u7684\u54cd\u5e94\u65f6\u95f4\u6765\u5206\u914d\u8bf7\u6c42\uff0c\u54cd\u5e94\u65f6\u95f4\u77ed\u7684\u4f18\u5148\u5206\u914d<\/p>\n<div>\n<pre>upstream backend {\r\n     fair;\r\n     server localhost:8080;    \r\n     server localhost:8081;\r\n}<\/pre>\n<\/div>\n<h3 data-pid=\"3iRNXkxK\">url_hash(\u7b2c\u4e09\u65b9)<\/h3>\n<p data-pid=\"VnhyA3_n\">\u6309\u8bbf\u95eeurl\u7684hash\u7ed3\u679c\u6765\u5206\u914d\u8bf7\u6c42\uff0c\u4f7f\u6bcf\u4e2aurl\u5b9a\u5411\u5230\u540c\u4e00\u4e2a\u540e\u7aef\u670d\u52a1\u5668\uff0c\u540e\u7aef\u670d\u52a1\u5668\u4e3a\u7f13\u5b58\u65f6\u6bd4\u8f83\u6709\u6548\u3002\u5728upstream\u4e2d\u52a0\u5165hash\u8bed\u53e5\uff0cserver\u8bed\u53e5\u4e2d\u4e0d\u80fd\u5199\u5165weight\u7b49\u5176\u4ed6\u7684\u53c2\u6570\uff0chash_method\u662f\u4f7f\u7528\u7684hash\u7b97\u6cd5\u3002<\/p>\n<div>\n<pre>upstream backend {\r\n     hash $request_uri;     \r\n     hash_method crc32;     \r\n     server localhost:8080;    \r\n     server localhost:8081;\r\n}<\/pre>\n<\/div>\n<h1>3.nginx\u73af\u5883\u642d\u5efa<\/h1>\n<h2>\u7248\u672c\u9009\u62e9<\/h2>\n<p>\u6700\u65b0\u7a33\u5b9a\u7248\u672c(stable),\u4e0a\u4e00\u4e2a\u6700\u65b0\u7a33\u5b9a\u7248, \u6700\u65b0\u7684lts\u7248\u672c(\u957f\u671f\u7ef4\u62a4\u7248\u672c)<\/p>\n<h4>\u73af\u5883\u51c6\u5907<\/h4>\n<p>[root@web01 ~]$ hostname -I<br \/>\n10.0.0.45 172.16.1.45<\/p>\n<p>[root@web02 ~]$ hostname -I<br \/>\n10.0.0.145 172.16.1.145<\/p>\n<p>[root@web03 ~]$ hostname -I<br \/>\n10.0.0.245 172.16.1.245<\/p>\n<h3>\u5b89\u88c5nginx<\/h3>\n<h4>\u7b2c\u4e00\u79cdyum<\/h4>\n<p>[root@web01 ~]$yum install nginx -y<\/p>\n<h4>\u7b2c\u4e8c\u79cd\u914d\u7f6e\u6e90\uff08\u5728\u5b98\u7f51\uff08<a href=\"https:\/\/nginx.org\/en\/linux_packages.html\">https:\/\/nginx.org\/en\/linux_packages.html<\/a>\uff09\u4e0a\u590d\u5236\u6e90\uff09<\/h4>\n<p>[root@web02 ~]$ cat \/etc\/yum.repos.d\/nginx.repo<br \/>\n[nginx-stable]<br \/>\nname=nginx stable repo<br \/>\nbaseurl=http:\/\/nginx.org\/packages\/centos\/$releasever\/$basearch\/<br \/>\ngpgcheck=1<br \/>\nenabled=1<br \/>\ngpgkey=https:\/\/nginx.org\/keys\/nginx_signing.key<br \/>\nmodule_hotfixes=true<\/p>\n<h4>\u542f\u52a8nginx<\/h4>\n<p>[root@web01 ~]$ systemctl start nginx<br \/>\n[root@web01 ~]$ systemctl enable nginx<\/p>\n<h4>\u68c0\u67e5\u7aef\u53e3\u8fdb\u7a0b<\/h4>\n<p>[root@web01 ~]$ ss -lntup | grep nginx<br \/>\ntcp LISTEN 0 128 *:80 *:* users:((&#8220;nginx&#8221;,pid=5906,fd=6),(&#8220;nginx&#8221;,pid=2233,fd=6))<br \/>\ntcp LISTEN 0 128 [::]:80 [::]:* users:((&#8220;nginx&#8221;,pid=5906,fd=7),(&#8220;nginx&#8221;,pid=2233,fd=7))<\/p>\n<p>[root@web01 ~]$ ps -ef | grep nginx<br \/>\nroot 2233 1 0 Jul27 ? 00:00:00 nginx: master process \/usr\/sbin\/nginx<br \/>\nnginx 5906 2233 0 20:19 ? 00:00:00 nginx: worker process<br \/>\nroot 5914 4610 0 20:19 pts\/0 00:00:00 grep &#8211;color=auto nginx<\/p>\n<h4>\u68c0\u67e5web\u662f\u5426\u53ef\u4ee5\u8bbf\u95ee<\/h4>\n<p>[root@web01 ~]$ curl 10.0.0.145<br \/>\n&lt;!DOCTYPE html&gt;<br \/>\n&lt;html&gt;<br \/>\n&lt;head&gt;<br \/>\n&lt;title&gt;Welcome to nginx!&lt;\/title&gt;<br \/>\n&lt;style&gt;<br \/>\nhtml { color-scheme: light dark; }<br \/>\nbody { width: 35em; margin: 0 auto;<br \/>\nfont-family: Tahoma, Verdana, Arial, sans-serif; }<br \/>\n&lt;\/style&gt;<br \/>\n&lt;\/head&gt;<br \/>\n&lt;body&gt;<br \/>\n&lt;h1&gt;Welcome to nginx!&lt;\/h1&gt;<br \/>\n&lt;p&gt;If you see this page, the nginx web server is successfully installed and<br \/>\nworking. Further configuration is required.&lt;\/p&gt;<\/p>\n<p>&lt;p&gt;For online documentation and support please refer to<br \/>\n&lt;a href=&#8221;http:\/\/nginx.org\/&#8221;&gt;nginx.org&lt;\/a&gt;.&lt;br\/&gt;<br \/>\nCommercial support is available at<br \/>\n&lt;a href=&#8221;http:\/\/nginx.com\/&#8221;&gt;nginx.com&lt;\/a&gt;.&lt;\/p&gt;<\/p>\n<p>&lt;p&gt;&lt;em&gt;Thank you for using nginx.&lt;\/em&gt;&lt;\/p&gt;<br \/>\n&lt;\/body&gt;<br \/>\n&lt;\/html&gt;<\/p>\n<h2>\u6d4b\u8bd5web\u9875\u9762<\/h2>\n<h4>\u4e0a\u4f20\u4e00\u4e2a\u538b\u7f29\u5305\uff0c\u89e3\u538b\u5230web\u663e\u793a\u76ee\u5f55<\/h4>\n<p>[root@web01 ~]$ cd \/usr\/share\/nginx\/html\/<br \/>\n[root@web01 \/usr\/share\/nginx\/html]$<\/p>\n<p>[root@web01 \/usr\/share\/nginx\/html]$ mkdir yx<\/p>\n<p>[root@web01 \/usr\/share\/nginx\/html\/yx]$ unzip 80\u6b3eH5\u5c0f\u6e38\u620f\u6e90\u7801\u5927\u5408\u96c6_\u5e26\u7f51\u9875\u5bfc\u822a.zip<\/p>\n<h4>\u8bbf\u95eeweb\u9875\u9762\uff08ip\u540e\u9762\u4e0a\u9700\u8981\u52a0\u4e0ayx\u7684\u76ee\u5f55\uff0c\u56e0\u4e3aindex.html\u5728\u8fd9\u4e2ayx\u76ee\u5f55\u91cc\uff0c\u6b63\u5e38\u5982\u679c.html\u7684\u6587\u4ef6\u653e\u5728html\u76ee\u5f55\u4e0b\u662f\u4e0d\u8981\u9700\u8981\u52a0\u4e0ayx\u76ee\u5f55\uff09<\/h4>\n<p><a href=\"https:\/\/www.qiangzhenshuai.com\/?attachment_id=700\" rel=\"attachment wp-att-700\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-700\" src=\"https:\/\/i0.wp.com\/www.qiangzhenshuai.com\/wp-content\/uploads\/2022\/07\/nginx-web\u6e38\u620f\u9875\u9762\u8bbf\u95ee.png?resize=640%2C351&#038;ssl=1\" alt=\"\" width=\"640\" height=\"351\" srcset=\"https:\/\/i0.wp.com\/www.qiangzhenshuai.com\/wp-content\/uploads\/2022\/07\/nginx-web\u6e38\u620f\u9875\u9762\u8bbf\u95ee.png?w=1765&amp;ssl=1 1765w, https:\/\/i0.wp.com\/www.qiangzhenshuai.com\/wp-content\/uploads\/2022\/07\/nginx-web\u6e38\u620f\u9875\u9762\u8bbf\u95ee.png?resize=300%2C165&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.qiangzhenshuai.com\/wp-content\/uploads\/2022\/07\/nginx-web\u6e38\u620f\u9875\u9762\u8bbf\u95ee.png?resize=1024%2C562&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.qiangzhenshuai.com\/wp-content\/uploads\/2022\/07\/nginx-web\u6e38\u620f\u9875\u9762\u8bbf\u95ee.png?resize=768%2C422&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.qiangzhenshuai.com\/wp-content\/uploads\/2022\/07\/nginx-web\u6e38\u620f\u9875\u9762\u8bbf\u95ee.png?resize=1536%2C843&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.qiangzhenshuai.com\/wp-content\/uploads\/2022\/07\/nginx-web\u6e38\u620f\u9875\u9762\u8bbf\u95ee.png?w=1280&amp;ssl=1 1280w\" sizes=\"(max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p>\u5728web\u4e0a\u663e\u793a\u6b63\u5e38<\/p>\n<h1>4.nginx\u914d\u7f6e\u6587\u4ef6<\/h1>\n<h2>\uff08yum\u5b89\u88c5\u548c\u6e90\u5b89\u88c5\u65f6\u4e0d\u592a\u4e00\u6837\u7684\uff09<\/h2>\n<h2>\/etc\/nginx\/nginx.conf<\/h2>\n<p>[root@web01 ~]$ cat \/etc\/nginx\/nginx.conf<\/p>\n<p>user nginx;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ##nginx\u8fd0\u884c\u7528\u6237\uff08\u9ed8\u8ba4\uff09<br \/>\nworker_processes auto;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ##worker\u8fdb\u7a0b\u6570\u91cf\uff08\u5904\u7406\u7528\u6237\u8bf7\u6c42\uff09<\/p>\n<p>error_log \/var\/log\/nginx\/error.log notice;\u00a0 \u00a0 \u00a0 \u00a0 ##error\u9519\u8bef\u65e5\u5fd7\u00a0 notice\u9519\u8bef\u65e5\u5fd7\u7ea7\u522b \u6216 debug<br \/>\npid \/var\/run\/nginx.pid;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0##nginx pid\u6587\u4ef6\u7f51\u5740<\/p>\n<p>events {\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0##events\u6a21\u5757\/\u533a\u57df<br \/>\nworker_connections 1024;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ##\u6bcf\u4e2aworker\u8fdb\u7a0b\u7684\u8fde\u63a5\u6570\uff08\u5e76\u53d1\uff09<br \/>\n}<\/p>\n<p>http {\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0##http\u533a\u57df\/\u6a21\u5757<br \/>\ninclude \/etc\/nginx\/mime.types;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ##\u5a92\u4f53\u7c7b\u578b\uff08\u6587\u4ef6\u7c7b\u578b\uff09include\u5f15\u7528\u6216\u5305\u542b\u5176\u5b83\u5730\u65b9\u914d\u7f6e\uff0c\u7cbe\u7b80nginx\u4e3b\u914d\u7f6e\u6587\u4ef6<br \/>\ndefault_type application\/octet-stream;<\/p>\n<p>log_format main &#8216;$remote_addr &#8211; $remote_user [$time_local] &#8220;$request&#8221; &#8216;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0##\u6307\u5b9anginx\u8bbf\u95ee\u65e5\u5fd7\u7684\u683c\u5f0f<br \/>\n&#8216;$status $body_bytes_sent &#8220;$http_referer&#8221; &#8216;<br \/>\n&#8216;&#8221;$http_user_agent&#8221; &#8220;$http_x_forwarded_for&#8221;&#8216;;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0##log format\u00a0 \u683c\u5f0f\u540d\u79f0 \u683c\u5f0f\u8be6\u7ec6\u5b9a\u4e49<\/p>\n<p>access_log \/var\/log\/nginx\/access.log main;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ##access.log\u6307\u5b9a\u65e5\u5fd7\u7684\u4f4d\u7f6e\u53ca\u683c\u5f0f<\/p>\n<p>sendfile on;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0##\u5f00\u542f\u9ad8\u6548\u4f20\u8f93\u6a21\u5f0f<br \/>\n#tcp_nopush on;<\/p>\n<p>keepalive_timeout 65;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0##keepalive\u8d85\u65f6\u65f6\u95f4<\/p>\n<p>#gzip on;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0##\u662f\u5426\u5f00\u542fgzip\u538b\u7f29 \u9759\u6001\u6587\u672c\u5185\u5bb9 \u8282\u7701\u5e26\u5bbd<\/p>\n<p>include \/etc\/nginx\/conf.d\/*.conf;\u00a0 \u00a0 \u00a0 \u00a0##\u5f15\u7528\u7684\u914d\u7f6e\u6587\u4ef6\u8def\u5f84<br \/>\n}<\/p>\n<h2>\/etc\/nginx\/conf.d\/default.conf<\/h2>\n<p>[root@web02 ~]$ cat \/etc\/nginx\/conf.d\/default.conf<br \/>\nserver {\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ##server\u533a\u57df<br \/>\nlisten 80;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ##\u76d1\u542c\u7684\u7aef\u53e3<br \/>\nserver_name localhost;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ##\u76d1\u542c\u7684\u670d\u52a1\u540d\u79f0\uff08\u57df\u540d\uff09<\/p>\n<p>#access_log \/var\/log\/nginx\/host.access.log main;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ##\u7f51\u7ad9\u8bbf\u95ee\u65e5\u5fd7\u8def\u5f84<\/p>\n<p>location \/ {\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0##location\u7528\u6765\u5339\u914duri<br \/>\nroot \/usr\/share\/nginx\/html;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ##\u8bbf\u95ee\u7684\u7ad9\u70b9\u76ee\u5f55<br \/>\nindex index.html index.htm;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ##\u6307\u5b9a\u7f51\u7ad9\u7684\u9996\u9875\u6587\u4ef6<br \/>\n}<\/p>\n<p>#error_page 404 \/404.html;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ##404\u9519\u8bef\u8fd4\u56de\u7684\u9875\u9762<\/p>\n<p># redirect server error pages to the static page \/50x.html<br \/>\n#<br \/>\nerror_page 500 502 503 504 \/50x.html;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ##500 502 503 504\u8fd4\u56de\u7684\u9875\u9762<br \/>\nlocation = \/50x.html {<br \/>\nroot \/usr\/share\/nginx\/html;<br \/>\n}<\/p>\n<p># proxy the PHP scripts to Apache listening on 127.0.0.1:80<br \/>\n#<br \/>\n#location ~ \\.php$ {\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ##nginx\u4ee3\u7406php\u7684\u914d\u7f6e\u6587\u4ef6<br \/>\n# proxy_pass http:\/\/127.0.0.1;<br \/>\n#}<\/p>\n<p># pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000<br \/>\n#<br \/>\n#location ~ \\.php$ {<br \/>\n# root html;<br \/>\n# fastcgi_pass 127.0.0.1:9000;<br \/>\n# fastcgi_index index.php;<br \/>\n# fastcgi_param SCRIPT_FILENAME \/scripts$fastcgi_script_name;<br \/>\n# include fastcgi_params;<br \/>\n#}<\/p>\n<p># deny access to .htaccess files, if Apache&#8217;s document root<br \/>\n# concurs with nginx&#8217;s one<br \/>\n#<br \/>\n#location ~ \/\\.ht {\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ##\u4ee5ht\u7ed3\u5c3e\u7684\u5168\u90e8\u62d2\u7edd\u8bbf\u95ee<br \/>\n# deny all;<br \/>\n#}<br \/>\n}<\/p>\n<h2>http{}server{}location{}\u5173\u8054<\/h2>\n<h4>http{}<\/h4>\n<p>\u5904\u7406\u7528\u6237http\u8bf7\u6c42<\/p>\n<h4>server{}<\/h4>\n<p>http\u8bf7\u6c42\u4e2d\uff0c\u7ad9\u70b9<\/p>\n<h4>location{}<\/h4>\n<p>server\u4e2d\u5339\u914d\u8bf7\u6c42\u4e2d\u7684uri<\/p>\n<h3>http{}\u5c42\u4e0b\u5141\u8bb8\u6709\u591a\u4e2aServer{}\uff0c\u4e00\u4e2aServer{}\u4e0b\u53c8\u6709\u591a\u4e2alocation{}<\/h3>\n<h1>5.\u81ea\u5b9a\u4e49nginx\u7684web\u7ad9\u70b9<\/h1>\n<h2>\u4e66\u5199nginx\u914d\u7f6e\u6587\u4ef6\uff0c\u5b9a\u4e49\u7aef\u53e3\uff0c\u5b9a\u4e49\u57df\u540d\uff0c\u5b9a\u4e49\u8fd4\u56de\u7684\u8def\u5f84\uff0c\u4ee5\u53ca\u9ed8\u8ba4\u9875\u9762<\/h2>\n<p>[root@web01 ~]$ cat \/etc\/nginx\/conf.d\/dmxsp.qiang.com.conf<br \/>\nserver {<br \/>\nlisten 80;<br \/>\nserver_name dmxsp.qiang.com;<\/p>\n<p>location \/ {<br \/>\nroot \/code\/dmxsp;<br \/>\nindex index.html index.php;<br \/>\n}<br \/>\n}<\/p>\n<h4>\u68c0\u67e5\u8bed\u6cd5<\/h4>\n<p>[root@web01 ~]$ nginx -t<br \/>\nnginx: the configuration file \/etc\/nginx\/nginx.conf syntax is ok<br \/>\nnginx: configuration file \/etc\/nginx\/nginx.conf test is successful<\/p>\n<h4>\u521b\u5efa\u6587\u4ef6\uff0c\u76ee\u5f55\uff0c\u5728\u6587\u4ef6\u91cc\u5199\u4e0a\u4e1c\u897f<\/h4>\n<p>[root@web01 ~]$ mkdir -p \/code\/dmxsp<\/p>\n<p>[root@web01 ~]$ cat \/code\/dmxsp\/index.html<br \/>\nqiang<\/p>\n<h4>\u91cd\u542fnginx<\/h4>\n<p>[root@web01 ~]$ systemctl reload nginx.service<\/p>\n<h4>\u914d\u7f6ehost\u52ab\u6301\uff0c\u901a\u8fc7\u57df\u540d\u8bbf\u95ee\u7f51\u7ad9<\/h4>\n<p>windows\u7684hosts\u6587\u4ef6\u8def\u5f84C:\\Windows\\System32\\drivers\\etc\\hosts<br \/>\n\uff08\u6700\u597d\u662f\u7528Notepad++\uff09<br \/>\nlinux\u7684hosts\u6587\u4ef6\u8def\u5f84\/etc\/hosts<\/p>\n<h4>\u9875\u9762\u6d4b\u8bd5<\/h4>\n<p><a href=\"https:\/\/www.qiangzhenshuai.com\/?attachment_id=704\" rel=\"attachment wp-att-704\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-704\" src=\"https:\/\/i0.wp.com\/www.qiangzhenshuai.com\/wp-content\/uploads\/2022\/07\/nginx\u9875\u9762\u6d4b\u8bd5.png?resize=640%2C358&#038;ssl=1\" alt=\"\" width=\"640\" height=\"358\" srcset=\"https:\/\/i0.wp.com\/www.qiangzhenshuai.com\/wp-content\/uploads\/2022\/07\/nginx\u9875\u9762\u6d4b\u8bd5.png?w=1075&amp;ssl=1 1075w, https:\/\/i0.wp.com\/www.qiangzhenshuai.com\/wp-content\/uploads\/2022\/07\/nginx\u9875\u9762\u6d4b\u8bd5.png?resize=300%2C168&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.qiangzhenshuai.com\/wp-content\/uploads\/2022\/07\/nginx\u9875\u9762\u6d4b\u8bd5.png?resize=1024%2C572&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.qiangzhenshuai.com\/wp-content\/uploads\/2022\/07\/nginx\u9875\u9762\u6d4b\u8bd5.png?resize=768%2C429&amp;ssl=1 768w\" sizes=\"(max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<h1>6.nginx\u865a\u62df\u4e3b\u673a<\/h1>\n<h3>\u865a\u62df\u4e3b\u673a,nginx\u914d\u7f6e\u4e2d\u7684\u591a\u4e2aserver{}\u533a\u57df ,\u6bcf\u4e2aserver{}\u5bf9\u5e94\u4e0d\u540c\u7684\u4e1a\u52a1(\u7ad9\u70b9)<\/h3>\n<h2>\u865a\u62df\u4e3b\u673a\u65b9\u5f0f<\/h2>\n<h4>\u57fa\u4e8e\u57df\u540d(host)\u7684\u865a\u62df\u4e3b\u673a<\/h4>\n<p>\u4e0d\u540c\u7684\u57df\u540d\u8bbf\u95ee\u4e0d\u540c\u7684,\u7ad9\u70b9<\/p>\n<h4>\u57fa\u4e8eIP\u7684\u865a\u62df\u4e3b\u673a<\/h4>\n<p>\u4e0d\u540c\u7684ip\u5730\u5740\u53ef\u4ee5\u8bbf\u95ee\u4e0d\u540c\u7684\u7ad9\u70b9<\/p>\n<h4>\u57fa\u4e8e\u7aef\u53e3\u7684\u865a\u62df\u4e3b\u673a<\/h4>\n<p>\u4e0d\u540c\u7684\u7aef\u53e3\u53ef\u4ee5\u8bbf\u95ee\u4e0d\u540c\u7684\u7ad9\u70b9\uff0c\u7528\u4e8e\u9690\u85cf\u91cd\u8981\u8def\u5f84\u6216\u4e1a\u52a1<\/p>\n<h3>\u57fa\u4e8e\u57df\u540d\u865a\u62df\u4e3b\u673a<\/h3>\n<h4>\u4fee\u6539\u914d\u7f6e<\/h4>\n<p>\/code\/dmxsp\u00a0 \u00a0 \u00a0index.html\u00a0 \u5185\u5bb9 qiang<br \/>\n\/code\/qiang\u00a0 \u00a0 \u00a0 index.html\u00a0 \u5185\u5bb9 dmxsp<\/p>\n<h4>\u4fee\u6539\u914d\u7f6e\u6587\u4ef6<\/h4>\n<p>[root@web01 ~]$ cat \/etc\/nginx\/conf.d\/dmxsp.qiang.com.conf<br \/>\nserver {<br \/>\nlisten 80;<br \/>\nserver_name dmxsp.qiang.com;<\/p>\n<p>location \/ {<br \/>\nroot \/code\/dmxsp;<br \/>\nindex index.html index.php;<br \/>\n}<br \/>\n}<br \/>\n[root@web01 ~]$ cat \/etc\/nginx\/conf.d\/qiang.dmxsp.com.conf<br \/>\nserver {<br \/>\nlisten 80;<br \/>\nserver_name qiang.dmxsp.com;<\/p>\n<p>location \/ {<br \/>\nroot \/code\/qiang;<br \/>\nindex index.html index.php;<br \/>\n}<br \/>\n}<\/p>\n<h4>\u521b\u5efa\u76ee\u5f55<\/h4>\n<p>[root@web01 ~]$ mkdir -p \/code\/qiang<br \/>\n[root@web01 ~]$ cat \/code\/qiang\/index.html<br \/>\ndmxsp<\/p>\n<h4>\u68c0\u67e5<\/h4>\n<p>[root@web01 ~]$ nginx -t<br \/>\nnginx: the configuration file \/etc\/nginx\/nginx.conf syntax is ok<br \/>\nnginx: configuration file \/etc\/nginx\/nginx.conf test is successful<\/p>\n<h4>\u91cd\u542fnginx<\/h4>\n<p>[root@web01 ~]$ systemctl reload nginx.service<\/p>\n<h4>\u6d4b\u8bd5<\/h4>\n<p><a href=\"https:\/\/www.qiangzhenshuai.com\/?attachment_id=705\" rel=\"attachment wp-att-705\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-705\" src=\"https:\/\/i0.wp.com\/www.qiangzhenshuai.com\/wp-content\/uploads\/2022\/07\/nginx\u57fa\u4e8e\u57df\u540d.png?resize=640%2C449&#038;ssl=1\" alt=\"\" width=\"640\" height=\"449\" srcset=\"https:\/\/i0.wp.com\/www.qiangzhenshuai.com\/wp-content\/uploads\/2022\/07\/nginx\u57fa\u4e8e\u57df\u540d.png?w=666&amp;ssl=1 666w, https:\/\/i0.wp.com\/www.qiangzhenshuai.com\/wp-content\/uploads\/2022\/07\/nginx\u57fa\u4e8e\u57df\u540d.png?resize=300%2C210&amp;ssl=1 300w\" sizes=\"(max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<h3>\u57fa\u4e8eip\u865a\u62df\u4e3b\u673a<\/h3>\n<h4>\u6dfb\u52a0\u4e00\u4e2a\u4e34\u65f6IP<\/h4>\n<p>[root@web01 ~]$ ip addr add 10.0.0.100\/24 dev eth0 label eth0:0<\/p>\n<h4>\u4fee\u6539\u914d\u7f6e\u6587\u4ef6<\/h4>\n<p>[root@web01 ~]$ cat \/etc\/nginx\/conf.d\/dmxsp.qiang.com.conf<br \/>\nserver {<br \/>\nlisten 10.0.0.45:80;<br \/>\n# server_name dmxsp.qiang.com;<\/p>\n<p>location \/ {<br \/>\nroot \/code\/dmxsp;<br \/>\nindex index.html index.php;<br \/>\n}<br \/>\n}<br \/>\n[root@web01 ~]$ cat \/etc\/nginx\/conf.d\/qiang.dmxsp.com.conf<br \/>\nserver {<br \/>\nlisten 10.0.0.100:80;<br \/>\n# server_name qiang.dmxsp.com;<\/p>\n<p>location \/ {<br \/>\nroot \/code\/qiang;<br \/>\nindex index.html index.php;<br \/>\n}<br \/>\n}<\/p>\n<h4>\u68c0\u67e5<\/h4>\n<p>[root@web01 ~]$ nginx -t<br \/>\nnginx: the configuration file \/etc\/nginx\/nginx.conf syntax is ok<br \/>\nnginx: configuration file \/etc\/nginx\/nginx.conf test is successful<\/p>\n<h4>\u91cd\u542fnginx<\/h4>\n<p>[root@web01 ~]$ systemctl reload nginx.service<\/p>\n<h4>\u6d4b\u8bd5<\/h4>\n<p><a href=\"https:\/\/www.qiangzhenshuai.com\/?attachment_id=706\" rel=\"attachment wp-att-706\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-706\" src=\"https:\/\/i0.wp.com\/www.qiangzhenshuai.com\/wp-content\/uploads\/2022\/07\/nginx\u57fa\u4e8eIP\u6d4b\u8bd5.png?resize=640%2C380&#038;ssl=1\" alt=\"\" width=\"640\" height=\"380\" srcset=\"https:\/\/i0.wp.com\/www.qiangzhenshuai.com\/wp-content\/uploads\/2022\/07\/nginx\u57fa\u4e8eIP\u6d4b\u8bd5.png?w=784&amp;ssl=1 784w, https:\/\/i0.wp.com\/www.qiangzhenshuai.com\/wp-content\/uploads\/2022\/07\/nginx\u57fa\u4e8eIP\u6d4b\u8bd5.png?resize=300%2C178&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.qiangzhenshuai.com\/wp-content\/uploads\/2022\/07\/nginx\u57fa\u4e8eIP\u6d4b\u8bd5.png?resize=768%2C456&amp;ssl=1 768w\" sizes=\"(max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<h3>\u57fa\u4e8e\u7aef\u53e3\u865a\u62df\u4e3b\u673a<\/h3>\n<h4>\u4fee\u6539\u914d\u7f6e\u6587\u4ef6<\/h4>\n<p>[root@web01 ~]$ cat \/etc\/nginx\/conf.d\/dmxsp.qiang.com.conf<br \/>\nserver {<br \/>\nlisten 85;<br \/>\nserver_name dmxsp.qiang.com;<\/p>\n<p>location \/ {<br \/>\nroot \/code\/dmxsp;<br \/>\nindex index.html index.php;<br \/>\n}<br \/>\n}<br \/>\n[root@web01 ~]$ cat \/etc\/nginx\/conf.d\/qiang.dmxsp.com.conf<br \/>\nserver {<br \/>\nlisten 8456;<br \/>\nserver_name qiang.dmxsp.com;<\/p>\n<p>location \/ {<br \/>\nroot \/code\/qiang;<br \/>\nindex index.html index.php;<br \/>\n}<br \/>\n}<\/p>\n<h4>\u68c0\u67e5<\/h4>\n<p>[root@web01 ~]$ nginx -t<br \/>\nnginx: the configuration file \/etc\/nginx\/nginx.conf syntax is ok<br \/>\nnginx: configuration file \/etc\/nginx\/nginx.conf test is successful<\/p>\n<h4>\u91cd\u542fnginx<\/h4>\n<p>[root@web01 ~]$ systemctl reload nginx.service<\/p>\n<h4>\u67e5\u770b\u7aef\u53e3<\/h4>\n<p>tcp LISTEN 0 128 *:8456 *:* users:((&#8220;nginx&#8221;,pid=8215,fd=12),(&#8220;nginx&#8221;,pid=2233,fd=12))<br \/>\ntcp LISTEN 0 128 *:85 *:* users:((&#8220;nginx&#8221;,pid=8215,fd=11),(&#8220;nginx&#8221;,pid=2233,fd=11))<\/p>\n<h4>\u6d4b\u8bd5<\/h4>\n<p><a href=\"https:\/\/www.qiangzhenshuai.com\/?attachment_id=707\" rel=\"attachment wp-att-707\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-707\" src=\"https:\/\/i0.wp.com\/www.qiangzhenshuai.com\/wp-content\/uploads\/2022\/07\/nginx\u57fa\u4e8e\u7aef\u53e3.png?resize=577%2C472&#038;ssl=1\" alt=\"\" width=\"577\" height=\"472\" srcset=\"https:\/\/i0.wp.com\/www.qiangzhenshuai.com\/wp-content\/uploads\/2022\/07\/nginx\u57fa\u4e8e\u7aef\u53e3.png?w=577&amp;ssl=1 577w, https:\/\/i0.wp.com\/www.qiangzhenshuai.com\/wp-content\/uploads\/2022\/07\/nginx\u57fa\u4e8e\u7aef\u53e3.png?resize=300%2C245&amp;ssl=1 300w\" sizes=\"(max-width: 577px) 100vw, 577px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<h1>7.nginx\u76ee\u5f55\u7ed3\u6784<\/h1>\n<h2>\u76ee\u5f55\u548c\u6587\u4ef6\uff08yum\u5b89\u88c5\u548c\u6e90\u5b89\u88c5\u6709\u6240\u4e0d\u540c\uff09<\/h2>\n<p>[root@web02 ~]$ rpm -ql nginx<br \/>\n\/etc\/logrotate.d\/nginx\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0##\u65e5\u5fd7\u5207\u5272\u6587\u4ef6<br \/>\n\/etc\/nginx\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ##nginx\u914d\u7f6e\u6587\u4ef6\u76ee\u5f55<br \/>\n\/etc\/nginx\/conf.d\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ##\u5b58\u653e\u7ad9\u70b9\u914d\u7f6e\u6587\u4ef6\u7684\u76ee\u5f55<br \/>\n\/etc\/nginx\/conf.d\/default.conf\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ##\u9ed8\u8ba4\u7684\u7ad9\u70b9\u914d\u7f6e\u6587\u4ef6<br \/>\n\/etc\/nginx\/fastcgi_params\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ##fastcgi\u53c2\u6570<br \/>\n\/etc\/nginx\/mime.types\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ##\u5a92\u4f53\u7c7b\u578b<br \/>\n\/etc\/nginx\/modules<br \/>\n\/etc\/nginx\/nginx.conf\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ##nginx\u4e3b\u914d\u7f6e\u6587\u4ef6<br \/>\n\/etc\/nginx\/scgi_params\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0##scgi\u53c2\u6570<br \/>\n\/etc\/nginx\/uwsgi_params\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ##uwsgi\u53c2\u6570<br \/>\n\/usr\/lib\/systemd\/system\/nginx-debug.service<br \/>\n\/usr\/lib\/systemd\/system\/nginx.service\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ##\u542f\u52a8\u6587\u4ef6<br \/>\n\/usr\/lib64\/nginx<br \/>\n\/usr\/lib64\/nginx\/modules\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ##nginx\u6a21\u5757\u5b58\u653e\u8def\u5f84<br \/>\n\/usr\/libexec\/initscripts\/legacy-actions\/nginx\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ##\u5f15\u5bfc\u7684\u811a\u672c\u6587\u4ef6\uff0c\u6ca1\u7528<br \/>\n\/usr\/libexec\/initscripts\/legacy-actions\/nginx\/check-reload\u00a0 \u00a0 \u00a0 ##\u5f15\u5bfc\u7684\u811a\u672c\u6587\u4ef6\uff0c\u6ca1\u7528<br \/>\n\/usr\/libexec\/initscripts\/legacy-actions\/nginx\/upgrade\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ##\u5f15\u5bfc\u7684\u811a\u672c\u6587\u4ef6\uff0c\u6ca1\u7528<br \/>\n\/usr\/sbin\/nginx\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ##nginx\u7684\u547d\u4ee4<br \/>\n\/usr\/sbin\/nginx-debug<br \/>\n\/usr\/share\/doc\/nginx-1.22.0\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ##nginx\u5e2e\u52a9\u6587\u6863\uff0c\u4e0d\u9700\u8981\uff0c\u770b\u5b98\u7f51\u5373\u53ef<br \/>\n\/usr\/share\/doc\/nginx-1.22.0\/COPYRIGHT\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ##nginx\u5e2e\u52a9\u6587\u6863\uff0c\u4e0d\u9700\u8981\uff0c\u770b\u5b98\u7f51\u5373\u53ef<br \/>\n\/usr\/share\/man\/man8\/nginx.8.gz\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0##nginx\u5e2e\u52a9\u6587\u6863\uff0c\u4e0d\u9700\u8981\uff0c\u770b\u5b98\u7f51\u5373\u53ef<br \/>\n\/usr\/share\/nginx\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0##nginx\u9ed8\u8ba4\u7684\u9875\u9762<br \/>\n\/usr\/share\/nginx\/html\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ##nginx\u9ed8\u8ba4\u7684\u9875\u9762<br \/>\n\/usr\/share\/nginx\/html\/50x.html\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0##nginx\u9ed8\u8ba4\u7684\u9875\u9762<br \/>\n\/usr\/share\/nginx\/html\/index.html\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ##nginx\u9ed8\u8ba4\u7684\u9875\u9762<br \/>\n\/var\/cache\/nginx\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ##nginx\u7684\u7f13\u5b58\u76ee\u5f55<br \/>\n\/var\/log\/nginx\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ##Nginx\u9ed8\u8ba4\u5b58\u653e\u65e5\u5fd7\u76ee\u5f55<br \/>\n\/etc\/nginx\/koi-utf\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0##Nginx\u7f16\u7801\u8f6c\u6362\u6620\u5c04\u6587\u4ef6<br \/>\n\/etc\/nginx\/koi-win\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ##Nginx\u7f16\u7801\u8f6c\u6362\u6620\u5c04\u6587\u4ef6<\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[19],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.qiangzhenshuai.com\/index.php?rest_route=\/wp\/v2\/posts\/696"}],"collection":[{"href":"https:\/\/www.qiangzhenshuai.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qiangzhenshuai.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qiangzhenshuai.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qiangzhenshuai.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=696"}],"version-history":[{"count":7,"href":"https:\/\/www.qiangzhenshuai.com\/index.php?rest_route=\/wp\/v2\/posts\/696\/revisions"}],"predecessor-version":[{"id":955,"href":"https:\/\/www.qiangzhenshuai.com\/index.php?rest_route=\/wp\/v2\/posts\/696\/revisions\/955"}],"wp:attachment":[{"href":"https:\/\/www.qiangzhenshuai.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=696"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qiangzhenshuai.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=696"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qiangzhenshuai.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=696"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}