{"id":294,"date":"2023-05-27T20:12:45","date_gmt":"2023-05-27T12:12:45","guid":{"rendered":"https:\/\/xinchewhd.com.cn\/?p=294"},"modified":"2024-01-10T14:38:03","modified_gmt":"2024-01-10T06:38:03","slug":"b94d524c52","status":"publish","type":"post","link":"https:\/\/xinchewhd.com.cn\/index.php\/nginx\/b94d524c52\/","title":{"rendered":"40\u4e2a Nginx \u5e38\u95ee\u9762\u8bd5\u9898"},"content":{"rendered":"<section data-tool=\"mdnice\u7f16\u8f91\u5668\" data-website=\"https:\/\/www.mdnice.com\" data-mpa-powered-by=\"yiban.io\">\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-src=\"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201047176.jpg\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-galleryid=\"\" data-ratio=\"0.5305555555555556\" data-s=\"300,640\" data-data-src=\"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201047176.jpg\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-type=\"jpeg\" data-w=\"1080\" \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" src=\"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201047176.jpg\" data-galleryid=\"\" data-ratio=\"0.5305555555555556\" data-s=\"300,640\" data-src=\"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201047176.jpg\" data-type=\"jpeg\" data-w=\"1080\" \/><\/noscript><\/p>\n<blockquote style=\"font-size: 0.9em; overflow: auto; background: rgba(0, 0, 0, 0.05); margin-bottom: 20px; margin-top: 20px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; line-height: 1.8; color: #888888; border: initial none initial;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><p><span style=\"color: #555555; font-size: 4em; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201c<\/span><\/p>\n<p style=\"font-size: 16px; padding-top: 8px; padding-bottom: 8px; color: black; line-height: 26px; display: inline;\">Nginx \u662f\u4e00\u6b3e\u8f7b\u91cf\u7ea7\u7684 Web \u670d\u52a1\u5668\u3001\u53cd\u5411\u4ee3\u7406\u670d\u52a1\u5668\uff0c\u7531\u4e8e\u5b83\u7684\u5185\u5b58\u5360\u7528\u5c11\uff0c\u542f\u52a8\u6781\u5feb\uff0c\u9ad8\u5e76\u53d1\u80fd\u529b\u5f3a\uff0c\u5728\u4e92\u8054\u7f51\u9879\u76ee\u4e2d\u5e7f\u6cdb\u5e94\u7528\u3002<\/p>\n<\/blockquote>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u90a3\u4e48\u5173\u4e8e Nginx \u7684\u6838\u5fc3\u6280\u672f\u70b9\u6709\u54ea\u4e9b\u5462\uff1f<\/p>\n<figure style=\"margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-src=\"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201048844.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-ratio=\"2.1921568627450982\" data-data-src=\"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201048844.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-w=\"765\" \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" src=\"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201048844.png\" data-ratio=\"2.1921568627450982\" data-src=\"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201048844.png\" data-w=\"765\" \/><\/noscript><\/figure>\n<h2 style=\"margin-top: 30px; font-weight: bold; font-size: 22px; border-bottom: 2px solid #595959; margin-bottom: 30px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"display: inline-block; border-bottom: 2px solid #595959;\"><strong style=\"color: #47c1a8;\">\u4ec0\u4e48\u662f Nginx\uff1f<\/strong><\/span><\/h2>\n<blockquote style=\"font-size: 0.9em; overflow: auto; background: rgba(0, 0, 0, 0.05); margin-bottom: 20px; margin-top: 20px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; line-height: 1.8; color: #888888; border: initial none initial;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><p><span style=\"color: #555555; font-size: 4em; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201c<\/span><\/p>\n<p style=\"font-size: 16px; padding-top: 8px; padding-bottom: 8px; color: black; line-height: 26px; display: inline;\">Nginx \u662f\u4e00\u4e2a \u8f7b\u91cf\u7ea7 \/ \u9ad8\u6027\u80fd\u7684\u53cd\u5411\u4ee3\u7406 Web \u670d\u52a1\u5668\uff0c\u7528\u4e8e HTTP\u3001HTTPS\u3001SMTP\u3001POP3 \u548c IMAP \u534f\u8bae\u3002\u4ed6\u5b9e\u73b0\u975e\u5e38\u9ad8\u6548\u7684\u53cd\u5411\u4ee3\u7406\u3001\u8d1f\u8f7d\u5e73\u8861\uff0c\u4ed6\u53ef\u4ee5\u5904\u7406 2-3 \u4e07\u5e76\u53d1\u8fde\u63a5\u6570\uff0c\u5b98\u65b9\u76d1\u6d4b\u80fd\u652f\u6301 5 \u4e07\u5e76\u53d1\uff0c\u73b0\u5728\u4e2d\u56fd\u4f7f\u7528 nginx \u7f51\u7ad9\u7528\u6237\u6709\u5f88\u591a\uff0c\u4f8b\u5982\uff1a\u65b0\u6d6a\u3001\u7f51\u6613\u3001 \u817e\u8baf\u7b49\u3002<\/p>\n<\/blockquote>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong style=\"color: #47c1a8;\">Nginx \u6709\u54ea\u4e9b\u4f18\u70b9\uff1f<\/strong><\/p>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\">\u8de8\u5e73\u53f0\u3001\u914d\u7f6e\u7b80\u5355\u3002<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\">\u975e\u963b\u585e\u3001\u9ad8\u5e76\u53d1\u8fde\u63a5\uff1a\u5904\u7406 2-3 \u4e07\u5e76\u53d1\u8fde\u63a5\u6570\uff0c\u5b98\u65b9\u76d1\u6d4b\u80fd\u652f\u6301 5 \u4e07\u5e76\u53d1\u3002<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\">\u5185\u5b58\u6d88\u8017<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\">\u5c0f\uff1a\u5f00\u542f 10 \u4e2a Nginx \u624d\u5360 150M \u5185\u5b58\u3002<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\">\u6210\u672c\u4f4e\u5ec9\uff0c\u4e14\u5f00\u6e90\u3002<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\">\u7a33\u5b9a\u6027\u9ad8\uff0c\u5b95\u673a\u7684\u6982\u7387\u975e\u5e38\u5c0f\u3002<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\">\u5185\u7f6e\u7684\u5065\u5eb7\u68c0\u67e5\u529f\u80fd\uff1a\u5982\u679c\u6709\u4e00\u4e2a\u670d\u52a1\u5668\u5b95\u673a\uff0c\u4f1a\u505a\u4e00\u4e2a\u5065\u5eb7\u68c0\u67e5\uff0c\u518d\u53d1\u9001\u7684\u8bf7\u6c42\u5c31\u4e0d\u4f1a\u53d1\u9001\u5230\u5b95\u673a\u7684\u670d\u52a1\u5668\u4e86\u3002\u91cd\u65b0\u5c06\u8bf7\u6c42\u63d0\u4ea4\u5230\u5176\u4ed6\u7684\u8282\u70b9\u4e0a<\/p>\n<\/section>\n<\/li>\n<\/ul>\n<h2 style=\"margin-top: 30px; font-weight: bold; font-size: 22px; border-bottom: 2px solid #595959; margin-bottom: 30px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"display: inline-block; border-bottom: 2px solid #595959;\"><strong style=\"color: #47c1a8;\">Nginx \u5e94\u7528\u573a\u666f\uff1f<\/strong><\/span><\/h2>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\">http \u670d\u52a1\u5668\u3002Nginx \u662f\u4e00\u4e2a http \u670d\u52a1\u53ef\u4ee5\u72ec\u7acb\u63d0\u4f9b http \u670d\u52a1\u3002\u53ef\u4ee5\u505a\u7f51\u9875\u9759\u6001\u670d\u52a1\u5668\u3002<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\">\u865a\u62df\u4e3b\u673a\u3002\u53ef\u4ee5\u5b9e\u73b0\u5728\u4e00\u53f0\u670d\u52a1\u5668\u865a\u62df\u51fa\u591a\u4e2a\u7f51\u7ad9\uff0c\u4f8b\u5982\u4e2a\u4eba\u7f51\u7ad9\u4f7f\u7528\u7684\u865a\u62df\u673a\u3002<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\">\u53cd\u5411\u4ee3\u7406\uff0c\u8d1f\u8f7d\u5747\u8861\u3002\u5f53\u7f51\u7ad9\u7684\u8bbf\u95ee\u91cf\u8fbe\u5230\u4e00\u5b9a\u7a0b\u5ea6\u540e\uff0c\u5355\u53f0\u670d\u52a1\u5668\u4e0d\u80fd\u6ee1\u8db3\u7528\u6237\u7684\u8bf7\u6c42\u65f6\uff0c\u9700\u8981\u7528\u591a\u53f0\u670d\u52a1\u5668\u96c6\u7fa4\u53ef\u4ee5\u4f7f\u7528 nginx \u505a\u53cd\u5411\u4ee3\u7406\u3002\u5e76\u4e14\u591a\u53f0\u670d\u52a1\u5668\u53ef\u4ee5\u5e73\u5747\u5206\u62c5\u8d1f\u8f7d\uff0c\u4e0d\u4f1a\u5e94\u4e3a\u67d0\u53f0\u670d\u52a1\u5668\u8d1f\u8f7d\u9ad8\u5b95\u673a\u800c\u67d0\u53f0\u670d\u52a1\u5668\u95f2\u7f6e\u7684\u60c5\u51b5\u3002<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\">nginz \u4e2d\u4e5f\u53ef\u4ee5\u914d\u7f6e\u5b89\u5168\u7ba1\u7406\u3001\u6bd4\u5982\u53ef\u4ee5\u4f7f\u7528 Nginx \u642d\u5efa API \u63a5\u53e3\u7f51\u5173, \u5bf9\u6bcf\u4e2a\u63a5\u53e3\u670d\u52a1\u8fdb\u884c\u62e6\u622a\u3002<\/p>\n<\/section>\n<\/li>\n<\/ul>\n<h2 style=\"margin-top: 30px; font-weight: bold; font-size: 22px; border-bottom: 2px solid #595959; margin-bottom: 30px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"display: inline-block; border-bottom: 2px solid #595959;\"><strong style=\"color: #47c1a8;\">Nginx \u600e\u4e48\u5904\u7406\u8bf7\u6c42\u7684\uff1f<\/strong><\/span><\/h2>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\">server\u00a0{\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u7b2c\u4e00\u4e2aServer\u533a\u5757\u5f00\u59cb\uff0c\u8868\u793a\u4e00\u4e2a\u72ec\u7acb\u7684\u865a\u62df\u4e3b\u673a\u7ad9\u70b9<\/span>\n\u00a0\u00a0 listen \u00a0\u00a0\u00a0\u00a0\u00a0 80\uff1b<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u63d0\u4f9b\u670d\u52a1\u7684\u7aef\u53e3\uff0c\u9ed8\u8ba480<\/span>\n\u00a0\u00a0\u00a0server_name\u00a0localhost;\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u63d0\u4f9b\u670d\u52a1\u7684\u57df\u540d\u4e3b\u673a\u540d<\/span>\n\u00a0\u00a0\u00a0location\u00a0\/\u00a0{\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u7b2c\u4e00\u4e2alocation\u533a\u5757\u5f00\u59cb<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0root\u00a0\u00a0\u00a0html;\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u7ad9\u70b9\u7684\u6839\u76ee\u5f55\uff0c\u76f8\u5f53\u4e8eNginx\u7684\u5b89\u88c5\u76ee\u5f55<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0index\u00a0\u00a0index.html\u00a0index.html;\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u9ed8\u8ba4\u7684\u9996\u9875\u6587\u4ef6\uff0c\u591a\u4e2a\u7528\u7a7a\u683c\u5206\u5f00<\/span>\n}\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u7b2c\u4e00\u4e2alocation\u533a\u5757\u7ed3\u679c<\/span>\n<\/code><\/pre>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\">\u9996\u5148\uff0cNginx \u5728\u542f\u52a8\u65f6\uff0c\u4f1a\u89e3\u6790\u914d\u7f6e\u6587\u4ef6\uff0c\u5f97\u5230\u9700\u8981\u76d1\u542c\u7684\u7aef\u53e3\u4e0e IP \u5730\u5740\uff0c\u7136\u540e\u5728 Nginx \u7684 Master \u8fdb\u7a0b\u91cc\u9762\u5148\u521d\u59cb\u5316\u597d\u8fd9\u4e2a\u76d1\u63a7\u7684 Socket(\u521b\u5efa S ocket\uff0c\u8bbe\u7f6e addr\u3001reuse \u7b49\u9009\u9879\uff0c\u7ed1\u5b9a\u5230\u6307\u5b9a\u7684 ip \u5730\u5740\u7aef\u53e3\uff0c\u518d listen \u76d1\u542c)\u3002<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\">\u7136\u540e\uff0c\u518d fork(\u4e00\u4e2a\u73b0\u6709\u8fdb\u7a0b\u53ef\u4ee5\u8c03\u7528 fork \u51fd\u6570\u521b\u5efa\u4e00\u4e2a\u65b0\u8fdb\u7a0b\u3002\u7531 fork \u521b\u5efa\u7684\u65b0\u8fdb\u7a0b\u88ab\u79f0\u4e3a\u5b50\u8fdb\u7a0b) \u51fa\u591a\u4e2a\u5b50\u8fdb\u7a0b\u51fa\u6765\u3002<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\">\u4e4b\u540e\uff0c\u5b50\u8fdb\u7a0b\u4f1a\u7ade\u4e89 accept \u65b0\u7684\u8fde\u63a5\u3002\u6b64\u65f6\uff0c\u5ba2\u6237\u7aef\u5c31\u53ef\u4ee5\u5411 nginx \u53d1\u8d77\u8fde\u63a5\u4e86\u3002\u5f53\u5ba2\u6237\u7aef\u4e0e nginx \u8fdb\u884c\u4e09\u6b21\u63e1\u624b\uff0c\u4e0e nginx \u5efa\u7acb\u597d\u4e00\u4e2a\u8fde\u63a5\u540e\u3002\u6b64\u65f6\uff0c\u67d0\u4e00\u4e2a\u5b50\u8fdb\u7a0b\u4f1a accept \u6210\u529f\uff0c\u5f97\u5230\u8fd9\u4e2a\u5efa\u7acb\u597d\u7684\u8fde\u63a5\u7684 Socket \uff0c\u7136\u540e\u521b\u5efa nginx \u5bf9\u8fde\u63a5\u7684\u5c01\u88c5\uff0c\u5373 ngx_connection_t \u7ed3\u6784\u4f53\u3002<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\">\u63a5\u7740\uff0c\u8bbe\u7f6e\u8bfb\u5199\u4e8b\u4ef6\u5904\u7406\u51fd\u6570\uff0c\u5e76\u6dfb\u52a0\u8bfb\u5199\u4e8b\u4ef6\u6765\u4e0e\u5ba2\u6237\u7aef\u8fdb\u884c\u6570\u636e\u7684\u4ea4\u6362\u3002<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\">\u6700\u540e\uff0cNginx \u6216\u5ba2\u6237\u7aef\u6765\u4e3b\u52a8\u5173\u6389\u8fde\u63a5\uff0c\u5230\u6b64\uff0c\u4e00\u4e2a\u8fde\u63a5\u5c31\u5bff\u7ec8\u6b63\u5bdd\u4e86\u3002<\/p>\n<\/section>\n<\/li>\n<\/ul>\n<h2 style=\"margin-top: 30px; font-weight: bold; font-size: 22px; border-bottom: 2px solid #595959; margin-bottom: 30px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"display: inline-block; border-bottom: 2px solid #595959;\"><strong style=\"color: #47c1a8;\">Nginx \u662f\u5982\u4f55\u5b9e\u73b0\u9ad8\u5e76\u53d1\u7684\uff1f<\/strong><\/span><\/h2>\n<blockquote style=\"font-size: 0.9em; overflow: auto; background: rgba(0, 0, 0, 0.05); margin-bottom: 20px; margin-top: 20px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; line-height: 1.8; color: #888888; border: initial none initial;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><p><span style=\"color: #555555; font-size: 4em; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201c<\/span><\/p>\n<p style=\"font-size: 16px; padding-top: 8px; padding-bottom: 8px; color: black; line-height: 26px; display: inline;\">\u5982\u679c\u4e00\u4e2a server \u91c7\u7528\u4e00\u4e2a\u8fdb\u7a0b (\u6216\u8005\u7ebf\u7a0b) \u8d1f\u8d23\u4e00\u4e2a request \u7684\u65b9\u5f0f\uff0c\u90a3\u4e48\u8fdb\u7a0b\u6570\u5c31\u662f\u5e76\u53d1\u6570\u3002\u90a3\u4e48\u663e\u800c\u6613\u89c1\u7684\uff0c\u5c31\u662f\u4f1a\u6709\u5f88\u591a\u8fdb\u7a0b\u5728\u7b49\u5f85\u4e2d\u3002\u7b49\u4ec0\u4e48\uff1f\u6700\u591a\u7684\u5e94\u8be5\u662f\u7b49\u5f85\u7f51\u7edc\u4f20\u8f93\u3002<\/p>\n<\/blockquote>\n<blockquote style=\"font-size: 0.9em; overflow: auto; background: rgba(0, 0, 0, 0.05); margin-bottom: 20px; margin-top: 20px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; line-height: 1.8; color: #888888; border: initial none initial;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><p><span style=\"color: #555555; font-size: 4em; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201c<\/span><\/p>\n<p style=\"font-size: 16px; padding-top: 8px; padding-bottom: 8px; color: black; line-height: 26px; display: inline;\">\u800c Nginx \u7684\u5f02\u6b65\u975e\u963b\u585e\u5de5\u4f5c\u65b9\u5f0f\u6b63\u662f\u5229\u7528\u4e86\u8fd9\u70b9\u7b49\u5f85\u7684\u65f6\u95f4\u3002\u5728\u9700\u8981\u7b49\u5f85\u7684\u65f6\u5019\uff0c\u8fd9\u4e9b\u8fdb\u7a0b\u5c31\u7a7a\u95f2\u51fa\u6765\u5f85\u547d\u4e86\u3002\u56e0\u6b64\u8868\u73b0\u4e3a\u5c11\u6570\u51e0\u4e2a\u8fdb\u7a0b\u5c31\u89e3\u51b3\u4e86\u5927\u91cf\u7684\u5e76\u53d1\u95ee\u9898\u3002<\/p>\n<\/blockquote>\n<blockquote style=\"font-size: 0.9em; overflow: auto; background: rgba(0, 0, 0, 0.05); margin-bottom: 20px; margin-top: 20px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; line-height: 1.8; color: #888888; border: initial none initial;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><p><span style=\"color: #555555; font-size: 4em; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201c<\/span><\/p>\n<p style=\"font-size: 16px; padding-top: 8px; padding-bottom: 8px; color: black; line-height: 26px; display: inline;\">Nginx \u662f\u5982\u4f55\u5229\u7528\u7684\u5462\uff0c\u7b80\u5355\u6765\u8bf4\uff1a\u540c\u6837\u7684 4 \u4e2a\u8fdb\u7a0b\uff0c\u5982\u679c\u91c7\u7528\u4e00\u4e2a\u8fdb\u7a0b\u8d1f\u8d23\u4e00\u4e2a request \u7684\u65b9\u5f0f\uff0c\u90a3\u4e48\uff0c\u540c\u65f6\u8fdb\u6765 4 \u4e2a request \u4e4b\u540e\uff0c\u6bcf\u4e2a\u8fdb\u7a0b\u5c31\u8d1f\u8d23\u5176\u4e2d\u4e00\u4e2a\uff0c\u76f4\u81f3\u4f1a\u8bdd\u5173\u95ed\u3002\u671f\u95f4\uff0c\u5982\u679c\u6709\u7b2c 5 \u4e2a request \u8fdb\u6765\u4e86\u3002\u5c31\u65e0\u6cd5\u53ca\u65f6\u53cd\u5e94\u4e86\uff0c\u56e0\u4e3a 4 \u4e2a\u8fdb\u7a0b\u90fd\u6ca1\u5e72\u5b8c\u6d3b\u5462\uff0c\u56e0\u6b64\uff0c\u4e00\u822c\u6709\u4e2a\u8c03\u5ea6\u8fdb\u7a0b\uff0c\u6bcf\u5f53\u65b0\u8fdb\u6765\u4e86\u4e00\u4e2a request \uff0c\u5c31\u65b0\u5f00\u4e2a\u8fdb\u7a0b\u6765\u5904\u7406\u3002<\/p>\n<\/blockquote>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u56de\u60f3\u4e0b\uff0cBIO \u662f\u4e0d\u662f\u5b58\u5728\u9171\u7d2b\u7684\u95ee\u9898\uff1f<\/p>\n<blockquote style=\"font-size: 0.9em; overflow: auto; background: rgba(0, 0, 0, 0.05); margin-bottom: 20px; margin-top: 20px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; line-height: 1.8; color: #888888; border: initial none initial;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><p><span style=\"color: #555555; font-size: 4em; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201c<\/span><\/p>\n<p style=\"font-size: 16px; padding-top: 8px; padding-bottom: 8px; color: black; line-height: 26px; display: inline;\">Nginx \u4e0d\u8fd9\u6837\uff0c\u6bcf\u8fdb\u6765\u4e00\u4e2a request \uff0c\u4f1a\u6709\u4e00\u4e2a worker \u8fdb\u7a0b\u53bb\u5904\u7406\u3002\u4f46\u4e0d\u662f\u5168\u7a0b\u7684\u5904\u7406\uff0c\u5904\u7406\u5230\u4ec0\u4e48\u7a0b\u5ea6\u5462\uff1f\u5904\u7406\u5230\u53ef\u80fd\u53d1\u751f\u963b\u585e\u7684\u5730\u65b9\uff0c\u6bd4\u5982\u5411\u4e0a\u6e38\uff08\u540e\u7aef\uff09\u670d\u52a1\u5668\u8f6c\u53d1 request \uff0c\u5e76\u7b49\u5f85\u8bf7\u6c42\u8fd4\u56de\u3002\u90a3\u4e48\uff0c\u8fd9\u4e2a\u5904\u7406\u7684 worker \u4e0d\u4f1a\u8fd9\u4e48\u50bb\u7b49\u7740\uff0c\u4ed6\u4f1a\u5728\u53d1\u9001\u5b8c\u8bf7\u6c42\u540e\uff0c\u6ce8\u518c\u4e00\u4e2a\u4e8b\u4ef6\uff1a\u201c\u5982\u679c upstream \u8fd4\u56de\u4e86\uff0c\u544a\u8bc9\u6211\u4e00\u58f0\uff0c\u6211\u518d\u63a5\u7740\u5e72\u201d\u3002\u4e8e\u662f\u4ed6\u5c31\u4f11\u606f\u53bb\u4e86\u3002\u6b64\u65f6\uff0c\u5982\u679c\u518d\u6709 request \u8fdb\u6765\uff0c\u4ed6\u5c31\u53ef\u4ee5\u5f88\u5feb\u518d\u6309\u8fd9\u79cd\u65b9\u5f0f\u5904\u7406\u3002\u800c\u4e00\u65e6\u4e0a\u6e38\u670d\u52a1\u5668\u8fd4\u56de\u4e86\uff0c\u5c31\u4f1a\u89e6\u53d1\u8fd9\u4e2a\u4e8b\u4ef6\uff0cworker \u624d\u4f1a\u6765\u63a5\u624b\uff0c\u8fd9\u4e2a request \u624d\u4f1a\u63a5\u7740\u5f80\u4e0b\u8d70\u3002<\/p>\n<\/blockquote>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u8fd9\u5c31\u662f\u4e3a\u4ec0\u4e48\u8bf4\uff0cNginx \u57fa\u4e8e\u4e8b\u4ef6\u6a21\u578b\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u7531\u4e8e web server \u7684\u5de5\u4f5c\u6027\u8d28\u51b3\u5b9a\u4e86\u6bcf\u4e2a request \u7684\u5927\u90e8\u4efd\u751f\u547d\u90fd\u662f\u5728\u7f51\u7edc\u4f20\u8f93\u4e2d\uff0c\u5b9e\u9645\u4e0a\u82b1\u8d39\u5728 server \u673a\u5668\u4e0a\u7684\u65f6\u95f4\u7247\u4e0d\u591a\u3002\u8fd9\u662f\u51e0\u4e2a\u8fdb\u7a0b\u5c31\u89e3\u51b3\u9ad8\u5e76\u53d1\u7684\u79d8\u5bc6\u6240\u5728\u3002\u5373\uff1a<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">webserver \u521a\u597d\u5c5e\u4e8e\u7f51\u7edc IO \u5bc6\u96c6\u578b\u5e94\u7528\uff0c\u4e0d\u7b97\u662f\u8ba1\u7b97\u5bc6\u96c6\u578b\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5f02\u6b65\uff0c\u975e\u963b\u585e\uff0c\u4f7f\u7528 epoll \uff0c\u548c\u5927\u91cf\u7ec6\u8282\u5904\u7684\u4f18\u5316\u3002\u4e5f\u6b63\u662f Nginx \u4e4b\u6240\u4ee5\u7136\u7684\u6280\u672f\u57fa\u77f3\u3002<\/p>\n<h2 style=\"margin-top: 30px; font-weight: bold; font-size: 22px; border-bottom: 2px solid #595959; margin-bottom: 30px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"display: inline-block; border-bottom: 2px solid #595959;\"><strong style=\"color: #47c1a8;\">\u4ec0\u4e48\u662f\u6b63\u5411\u4ee3\u7406\uff1f<\/strong><\/span><\/h2>\n<blockquote style=\"font-size: 0.9em; overflow: auto; background: rgba(0, 0, 0, 0.05); margin-bottom: 20px; margin-top: 20px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; line-height: 1.8; color: #888888; border: initial none initial;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><p><span style=\"color: #555555; font-size: 4em; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201c<\/span><\/p>\n<p style=\"font-size: 16px; padding-top: 8px; padding-bottom: 8px; color: black; line-height: 26px; display: inline;\">\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<\/p>\n<\/blockquote>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5ba2\u6237\u7aef\u624d\u80fd\u4f7f\u7528\u6b63\u5411\u4ee3\u7406\u3002\u6b63\u5411\u4ee3\u7406\u603b\u7ed3\u5c31\u4e00\u53e5\u8bdd\uff1a\u4ee3\u7406\u7aef\u4ee3\u7406\u7684\u662f\u5ba2\u6237\u7aef\u3002\u4f8b\u5982\u8bf4\uff1a\u6211\u4eec\u4f7f\u7528\u7684 OpenVPN \u7b49\u7b49\u3002<\/p>\n<h2 style=\"margin-top: 30px; font-weight: bold; font-size: 22px; border-bottom: 2px solid #595959; margin-bottom: 30px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"display: inline-block; border-bottom: 2px solid #595959;\"><strong style=\"color: #47c1a8;\">\u4ec0\u4e48\u662f\u53cd\u5411\u4ee3\u7406\uff1f<\/strong><\/span><\/h2>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u53cd\u5411\u4ee3\u7406\uff08Reverse Proxy\uff09\u65b9\u5f0f\uff0c\u662f\u6307\u4ee5\u4ee3\u7406\u670d\u52a1\u5668\u6765\u63a5\u53d7 Internet \u4e0a\u7684\u8fde\u63a5\u8bf7\u6c42\uff0c\u7136\u540e\u5c06\u8bf7\u6c42\uff0c\u53d1\u7ed9\u5185\u90e8\u7f51\u7edc\u4e0a\u7684\u670d\u52a1\u5668\u5e76\u5c06\u4ece\u670d\u52a1\u5668\u4e0a\u5f97\u5230\u7684\u7ed3\u679c\u8fd4\u56de\u7ed9 Internet \u4e0a\u8bf7\u6c42\u8fde\u63a5\u7684\u5ba2\u6237\u7aef\uff0c\u6b64\u65f6\u4ee3\u7406\u670d\u52a1\u5668\u5bf9\u5916\u5c31\u8868\u73b0\u4e3a\u4e00\u4e2a\u53cd\u5411\u4ee3\u7406\u670d\u52a1\u5668\u3002<\/p>\n<blockquote style=\"font-size: 0.9em; overflow: auto; background: rgba(0, 0, 0, 0.05); margin-bottom: 20px; margin-top: 20px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; line-height: 1.8; color: #888888; border: initial none initial;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><p><span style=\"color: #555555; font-size: 4em; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201c<\/span><\/p>\n<p style=\"font-size: 16px; padding-top: 8px; padding-bottom: 8px; color: black; line-height: 26px; display: inline;\">\u53cd\u5411\u4ee3\u7406\u603b\u7ed3\u5c31\u4e00\u53e5\u8bdd\uff1a\u4ee3\u7406\u7aef\u4ee3\u7406\u7684\u662f\u670d\u52a1\u7aef\u3002<\/p>\n<\/blockquote>\n<h2 style=\"margin-top: 30px; font-weight: bold; font-size: 22px; border-bottom: 2px solid #595959; margin-bottom: 30px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"display: inline-block; border-bottom: 2px solid #595959;\"><strong style=\"color: #47c1a8;\">\u53cd\u5411\u4ee3\u7406\u670d\u52a1\u5668\u7684\u4f18\u70b9\u662f\u4ec0\u4e48?<\/strong><\/span><\/h2>\n<blockquote style=\"font-size: 0.9em; overflow: auto; background: rgba(0, 0, 0, 0.05); margin-bottom: 20px; margin-top: 20px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; line-height: 1.8; color: #888888; border: initial none initial;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><p><span style=\"color: #555555; font-size: 4em; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201c<\/span><\/p>\n<p style=\"font-size: 16px; padding-top: 8px; padding-bottom: 8px; color: black; line-height: 26px; display: inline;\">\u53cd\u5411\u4ee3\u7406\u670d\u52a1\u5668\u53ef\u4ee5\u9690\u85cf\u6e90\u670d\u52a1\u5668\u7684\u5b58\u5728\u548c\u7279\u5f81\u3002\u5b83\u5145\u5f53\u4e92\u8054\u7f51\u4e91\u548c web \u670d\u52a1\u5668\u4e4b\u95f4\u7684\u4e2d\u95f4\u5c42\u3002\u8fd9\u5bf9\u4e8e\u5b89\u5168\u65b9\u9762\u6765\u8bf4\u662f\u5f88\u597d\u7684\uff0c\u7279\u522b\u662f\u5f53\u60a8\u4f7f\u7528 web \u6258\u7ba1\u670d\u52a1\u65f6\u3002<\/p>\n<\/blockquote>\n<h2 style=\"margin-top: 30px; font-weight: bold; font-size: 22px; border-bottom: 2px solid #595959; margin-bottom: 30px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"display: inline-block; border-bottom: 2px solid #595959;\"><strong style=\"color: #47c1a8;\">Nginx \u76ee\u5f55\u7ed3\u6784\u6709\u54ea\u4e9b\uff1f<\/strong><\/span><\/h2>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\">tree\u00a0\/usr\/<span style=\"color: #e6c07b; line-height: 26px;\">local<\/span>\/nginx\n\/usr\/<span style=\"color: #e6c07b; line-height: 26px;\">local<\/span>\/nginx\n\u251c\u2500\u2500\u00a0client_body_temp\n\u251c\u2500\u2500\u00a0conf\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0Nginx\u6240\u6709\u914d\u7f6e\u6587\u4ef6\u7684\u76ee\u5f55<\/span>\n\u2502\u00a0\u251c\u2500\u2500\u00a0fastcgi.conf\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0fastcgi\u76f8\u5173\u53c2\u6570\u7684\u914d\u7f6e\u6587\u4ef6<\/span>\n\u2502\u00a0\u251c\u2500\u2500\u00a0fastcgi.conf.default\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0fastcgi.conf\u7684\u539f\u59cb\u5907\u4efd\u6587\u4ef6<\/span>\n\u2502\u00a0\u251c\u2500\u2500\u00a0fastcgi_params\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0fastcgi\u7684\u53c2\u6570\u6587\u4ef6<\/span>\n\u2502\u00a0\u251c\u2500\u2500\u00a0fastcgi_params.default\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\n\u2502\u00a0\u251c\u2500\u2500\u00a0koi-utf\n\u2502\u00a0\u251c\u2500\u2500\u00a0koi-win\n\u2502\u00a0\u251c\u2500\u2500\u00a0mime.types\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u5a92\u4f53\u7c7b\u578b<\/span>\n\u2502\u00a0\u251c\u2500\u2500\u00a0mime.types.default\n\u2502\u00a0\u251c\u2500\u2500\u00a0nginx.conf\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0Nginx\u4e3b\u914d\u7f6e\u6587\u4ef6<\/span>\n\u2502\u00a0\u251c\u2500\u2500\u00a0nginx.conf.default\n\u2502\u00a0\u251c\u2500\u2500\u00a0scgi_params\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0scgi\u76f8\u5173\u53c2\u6570\u6587\u4ef6<\/span>\n\u2502\u00a0\u251c\u2500\u2500\u00a0scgi_params.default\u00a0\u00a0\n\u2502\u00a0\u251c\u2500\u2500\u00a0uwsgi_params\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0uwsgi\u76f8\u5173\u53c2\u6570\u6587\u4ef6<\/span>\n\u2502\u00a0\u251c\u2500\u2500\u00a0uwsgi_params.default\n\u2502\u00a0\u2514\u2500\u2500\u00a0win-utf\n\u251c\u2500\u2500\u00a0fastcgi_temp\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0fastcgi\u4e34\u65f6\u6570\u636e\u76ee\u5f55<\/span>\n\u251c\u2500\u2500\u00a0html\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0Nginx\u9ed8\u8ba4\u7ad9\u70b9\u76ee\u5f55<\/span>\n\u2502\u00a0\u251c\u2500\u2500\u00a050x.html\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u9519\u8bef\u9875\u9762\u4f18\u96c5\u66ff\u4ee3\u663e\u793a\u6587\u4ef6\uff0c\u4f8b\u5982\u5f53\u51fa\u73b0502\u9519\u8bef\u65f6\u4f1a\u8c03\u7528\u6b64\u9875\u9762<\/span>\n\u2502\u00a0\u2514\u2500\u2500\u00a0index.html\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u9ed8\u8ba4\u7684\u9996\u9875\u6587\u4ef6<\/span>\n\u251c\u2500\u2500\u00a0logs\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0Nginx\u65e5\u5fd7\u76ee\u5f55<\/span>\n\u2502\u00a0\u251c\u2500\u2500\u00a0access.log\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u8bbf\u95ee\u65e5\u5fd7\u6587\u4ef6<\/span>\n\u2502\u00a0\u251c\u2500\u2500\u00a0error.log\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u9519\u8bef\u65e5\u5fd7\u6587\u4ef6<\/span>\n\u2502\u00a0\u2514\u2500\u2500\u00a0nginx.pid\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0pid\u6587\u4ef6\uff0cNginx\u8fdb\u7a0b\u542f\u52a8\u540e\uff0c\u4f1a\u628a\u6240\u6709\u8fdb\u7a0b\u7684ID\u53f7\u5199\u5230\u6b64\u6587\u4ef6<\/span>\n\u251c\u2500\u2500\u00a0proxy_temp\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u4e34\u65f6\u76ee\u5f55<\/span>\n\u251c\u2500\u2500\u00a0sbin\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0Nginx\u547d\u4ee4\u76ee\u5f55<\/span>\n\u2502\u00a0\u2514\u2500\u2500\u00a0nginx\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0Nginx\u7684\u542f\u52a8\u547d\u4ee4<\/span>\n\u251c\u2500\u2500\u00a0scgi_temp\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u4e34\u65f6\u76ee\u5f55<\/span>\n\u2514\u2500\u2500\u00a0uwsgi_temp\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u4e34\u65f6\u76ee\u5f55<\/span>\n<\/code><\/pre>\n<h2 style=\"margin-top: 30px; font-weight: bold; font-size: 22px; border-bottom: 2px solid #595959; margin-bottom: 30px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"display: inline-block; border-bottom: 2px solid #595959;\"><strong style=\"color: #47c1a8;\">Nginx \u914d\u7f6e\u6587\u4ef6 nginx.conf \u6709\u54ea\u4e9b\u5c5e\u6027\u6a21\u5757?<\/strong><\/span><\/h2>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\">worker_processes  1\uff1b<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0worker\u8fdb\u7a0b\u7684\u6570\u91cf<\/span>\nevents\u00a0{\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u4e8b\u4ef6\u533a\u5757\u5f00\u59cb<\/span>\n\u00a0\u00a0\u00a0 worker_connections  1024\uff1b<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u6bcf\u4e2aworker\u8fdb\u7a0b\u652f\u6301\u7684\u6700\u5927\u8fde\u63a5\u6570<\/span>\n}\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u4e8b\u4ef6\u533a\u5757\u7ed3\u675f<\/span>\nhttp\u00a0{\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0HTTP\u533a\u5757\u5f00\u59cb<\/span>\n\u00a0\u00a0\u00a0 include \u00a0\u00a0\u00a0\u00a0\u00a0 mime.types\uff1b<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0Nginx\u652f\u6301\u7684\u5a92\u4f53\u7c7b\u578b\u5e93\u6587\u4ef6<\/span>\n\u00a0\u00a0\u00a0 default_type application\/octet-stream\uff1b<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u9ed8\u8ba4\u7684\u5a92\u4f53\u7c7b\u578b<\/span>\n\u00a0\u00a0\u00a0 sendfile on\uff1b<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u5f00\u542f\u9ad8\u6548\u4f20\u8f93\u6a21\u5f0f<\/span>\n\u00a0\u00a0\u00a0 keepalive_timeout 65\uff1b<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u8fde\u63a5\u8d85\u65f6<\/span>\n\u00a0\u00a0\u00a0\u00a0server\u00a0{\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u7b2c\u4e00\u4e2aServer\u533a\u5757\u5f00\u59cb\uff0c\u8868\u793a\u4e00\u4e2a\u72ec\u7acb\u7684\u865a\u62df\u4e3b\u673a\u7ad9\u70b9<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 listen \u00a0\u00a0\u00a0\u00a0\u00a0 80\uff1b<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u63d0\u4f9b\u670d\u52a1\u7684\u7aef\u53e3\uff0c\u9ed8\u8ba480<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 server_name localhost\uff1b<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u63d0\u4f9b\u670d\u52a1\u7684\u57df\u540d\u4e3b\u673a\u540d<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0location\u00a0\/\u00a0{\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u7b2c\u4e00\u4e2alocation\u533a\u5757\u5f00\u59cb<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 root \u00a0 html\uff1b<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u7ad9\u70b9\u7684\u6839\u76ee\u5f55\uff0c\u76f8\u5f53\u4e8eNginx\u7684\u5b89\u88c5\u76ee\u5f55<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 index index.html index.htm\uff1b<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u9ed8\u8ba4\u7684\u9996\u9875\u6587\u4ef6\uff0c\u591a\u4e2a\u7528\u7a7a\u683c\u5206\u5f00<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u7b2c\u4e00\u4e2alocation\u533a\u5757\u7ed3\u679c<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 error_page 500502503504 \u00a0\/50x.html\uff1b<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u51fa\u73b0\u5bf9\u5e94\u7684http\u72b6\u6001\u7801\u65f6\uff0c\u4f7f\u752850x.html\u56de\u5e94\u5ba2\u6237<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0location\u00a0=\u00a0\/50x.html\u00a0{\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0location\u533a\u5757\u5f00\u59cb\uff0c\u8bbf\u95ee50x.html<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 root \u00a0 html\uff1b<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u6307\u5b9a\u5bf9\u5e94\u7684\u7ad9\u70b9\u76ee\u5f55\u4e3ahtml<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0......\n<\/code><\/pre>\n<h2 style=\"margin-top: 30px; font-weight: bold; font-size: 22px; border-bottom: 2px solid #595959; margin-bottom: 30px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"display: inline-block; border-bottom: 2px solid #595959;\"><strong style=\"color: #47c1a8;\">cookie \u548c session \u533a\u522b\uff1f<\/strong><\/span><\/h2>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 18px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5171\u540c\uff1a<\/h4>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5b58\u653e\u7528\u6237\u4fe1\u606f\u3002\u5b58\u653e\u7684\u5f62\u5f0f\uff1akey-value \u683c\u5f0f \u53d8\u91cf\u548c\u53d8\u91cf\u5185\u5bb9\u952e\u503c\u5bf9\u3002<\/p>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 18px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u533a\u522b\uff1a<\/h4>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">cookie<\/p>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\">\u5b58\u653e\u5728\u5ba2\u6237\u7aef\u6d4f\u89c8\u5668<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\">\u6bcf\u4e2a\u57df\u540d\u5bf9\u5e94\u4e00\u4e2a cookie\uff0c\u4e0d\u80fd\u8de8\u8dc3\u57df\u540d\u8bbf\u95ee\u5176\u4ed6 cookie<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\">\u7528\u6237\u53ef\u4ee5\u67e5\u770b\u6216\u4fee\u6539 cookie<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\">http \u54cd\u5e94\u62a5\u6587\u91cc\u9762\u7ed9\u4f60\u6d4f\u89c8\u5668\u8bbe\u7f6e<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\">\u94a5\u5319\uff08\u7528\u4e8e\u6253\u5f00\u6d4f\u89c8\u5668\u4e0a\u9501\u5934\uff09<\/p>\n<\/section>\n<\/li>\n<\/ul>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">session:<\/p>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\">\u5b58\u653e\u5728\u670d\u52a1\u5668\uff08\u6587\u4ef6\uff0c\u6570\u636e\u5e93\uff0credis\uff09<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\">\u5b58\u653e\u654f\u611f\u4fe1\u606f<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\">\u9501\u5934<\/p>\n<\/section>\n<\/li>\n<\/ul>\n<h2 style=\"margin-top: 30px; font-weight: bold; font-size: 22px; border-bottom: 2px solid #595959; margin-bottom: 30px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"display: inline-block; border-bottom: 2px solid #595959;\"><strong style=\"color: #47c1a8;\">\u4e3a\u4ec0\u4e48 Nginx \u4e0d\u4f7f\u7528\u591a\u7ebf\u7a0b\uff1f<\/strong><\/span><\/h2>\n<blockquote style=\"font-size: 0.9em; overflow: auto; background: rgba(0, 0, 0, 0.05); margin-bottom: 20px; margin-top: 20px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; line-height: 1.8; color: #888888; border: initial none initial;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><p><span style=\"color: #555555; font-size: 4em; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201c<\/span><\/p>\n<p style=\"font-size: 16px; padding-top: 8px; padding-bottom: 8px; color: black; line-height: 26px; display: inline;\">Apache:\u00a0\u521b\u5efa\u591a\u4e2a\u8fdb\u7a0b\u6216\u7ebf\u7a0b\uff0c\u800c\u6bcf\u4e2a\u8fdb\u7a0b\u6216\u7ebf\u7a0b\u90fd\u4f1a\u4e3a\u5176\u5206\u914d cpu \u548c\u5185\u5b58\uff08\u7ebf\u7a0b\u8981\u6bd4\u8fdb\u7a0b\u5c0f\u7684\u591a\uff0c\u6240\u4ee5 worker \u652f\u6301\u6bd4 perfork \u9ad8\u7684\u5e76\u53d1\uff09\uff0c\u5e76\u53d1\u8fc7\u5927\u4f1a\u69a8\u5e72\u670d\u52a1\u5668\u8d44\u6e90\u3002<\/p>\n<\/blockquote>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">Nginx:\u00a0\u91c7\u7528\u5355\u7ebf\u7a0b\u6765\u5f02\u6b65\u975e\u963b\u585e\u5904\u7406\u8bf7\u6c42\uff08\u7ba1\u7406\u5458\u53ef\u4ee5\u914d\u7f6e Nginx \u4e3b\u8fdb\u7a0b\u7684\u5de5\u4f5c\u8fdb\u7a0b\u7684\u6570\u91cf\uff09(epoll)\uff0c\u4e0d\u4f1a\u4e3a\u6bcf\u4e2a\u8bf7\u6c42\u5206\u914d cpu \u548c\u5185\u5b58\u8d44\u6e90\uff0c\u8282\u7701\u4e86\u5927\u91cf\u8d44\u6e90\uff0c\u540c\u65f6\u4e5f\u51cf\u5c11\u4e86\u5927\u91cf\u7684 CPU \u7684\u4e0a\u4e0b\u6587\u5207\u6362\u3002\u6240\u4ee5\u624d\u4f7f\u5f97 Nginx \u652f\u6301\u66f4\u9ad8\u7684\u5e76\u53d1\u3002<\/p>\n<h2 style=\"margin-top: 30px; font-weight: bold; font-size: 22px; border-bottom: 2px solid #595959; margin-bottom: 30px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"display: inline-block; border-bottom: 2px solid #595959;\">nginx \u548c apache \u7684\u533a\u522b<\/span><\/h2>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u8f7b\u91cf\u7ea7\uff0c\u540c\u6837\u8d77 web \u670d\u52a1\uff0c\u6bd4 apache \u5360\u7528\u66f4\u5c11\u7684\u5185\u5b58\u548c\u8d44\u6e90\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u6297\u5e76\u53d1\uff0cnginx \u5904\u7406\u8bf7\u6c42\u662f\u5f02\u6b65\u975e\u963b\u585e\u7684\uff0c\u800c apache \u5219\u662f\u963b\u585e\u6027\u7684\uff0c\u5728\u9ad8\u5e76\u53d1\u4e0b nginx \u80fd\u4fdd\u6301\u4f4e\u8d44\u6e90\uff0c\u4f4e\u6d88\u8017\u9ad8\u6027\u80fd\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u9ad8\u5ea6\u6a21\u5757\u5316\u7684\u8bbe\u8ba1\uff0c\u7f16\u5199\u6a21\u5757\u76f8\u5bf9\u7b80\u5355\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u6700\u6838\u5fc3\u7684\u533a\u522b\u5728\u4e8e apache \u662f\u540c\u6b65\u591a\u8fdb\u7a0b\u6a21\u578b\uff0c\u4e00\u4e2a\u8fde\u63a5\u5bf9\u5e94\u4e00\u4e2a\u8fdb\u7a0b\uff0cnginx \u662f\u5f02\u6b65\u7684\uff0c\u591a\u4e2a\u8fde\u63a5\u53ef\u4ee5\u5bf9\u5e94\u4e00\u4e2a\u8fdb\u7a0b\u3002<\/p>\n<figure style=\"margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-src=\"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201103238.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-ratio=\"0.45555555555555555\" data-data-src=\"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201103238.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-w=\"1080\" \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" src=\"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201103238.png\" data-ratio=\"0.45555555555555555\" data-src=\"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201103238.png\" data-w=\"1080\" \/><\/noscript><\/figure>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong style=\"color: #47c1a8;\">\u4ec0\u4e48\u662f\u52a8\u6001\u8d44\u6e90\u3001\u9759\u6001\u8d44\u6e90\u5206\u79bb\uff1f<\/strong><\/p>\n<blockquote style=\"font-size: 0.9em; overflow: auto; background: rgba(0, 0, 0, 0.05); margin-bottom: 20px; margin-top: 20px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; line-height: 1.8; color: #888888; border: initial none initial;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><p><span style=\"color: #555555; font-size: 4em; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201c<\/span><\/p>\n<p style=\"font-size: 16px; padding-top: 8px; padding-bottom: 8px; color: black; line-height: 26px; display: inline;\">\u52a8\u6001\u8d44\u6e90\u3001\u9759\u6001\u8d44\u6e90\u5206\u79bb\uff0c\u662f\u8ba9\u52a8\u6001\u7f51\u7ad9\u91cc\u7684\u52a8\u6001\u7f51\u9875\u6839\u636e\u4e00\u5b9a\u89c4\u5219\u628a\u4e0d\u53d8\u7684\u8d44\u6e90\u548c\u7ecf\u5e38\u53d8\u7684\u8d44\u6e90\u533a\u5206\u5f00\u6765\uff0c\u52a8\u9759\u8d44\u6e90\u505a\u597d\u4e86\u62c6\u5206\u4ee5\u540e\u6211\u4eec\u5c31\u53ef\u4ee5\u6839\u636e\u9759\u6001\u8d44\u6e90\u7684\u7279\u70b9\u5c06\u5176\u505a\u7f13\u5b58\u64cd\u4f5c\uff0c\u8fd9\u5c31\u662f\u7f51\u7ad9\u9759\u6001\u5316\u5904\u7406\u7684\u6838\u5fc3\u601d\u8def\u3002<\/p>\n<\/blockquote>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u52a8\u6001\u8d44\u6e90\u3001\u9759\u6001\u8d44\u6e90\u5206\u79bb\u7b80\u5355\u7684\u6982\u62ec\u662f\uff1a\u52a8\u6001\u6587\u4ef6\u4e0e\u9759\u6001\u6587\u4ef6\u7684\u5206\u79bb\u3002<\/p>\n<h2 style=\"margin-top: 30px; font-weight: bold; font-size: 22px; border-bottom: 2px solid #595959; margin-bottom: 30px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"display: inline-block; border-bottom: 2px solid #595959;\"><strong style=\"color: #47c1a8;\">\u4e3a\u4ec0\u4e48\u8981\u505a\u52a8\u3001\u9759\u5206\u79bb\uff1f<\/strong><\/span><\/h2>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5728\u6211\u4eec\u7684\u8f6f\u4ef6\u5f00\u53d1\u4e2d\uff0c\u6709\u4e9b\u8bf7\u6c42\u662f\u9700\u8981\u540e\u53f0\u5904\u7406\u7684\uff08\u5982\uff1a.jsp,.do \u7b49\u7b49\uff09\uff0c\u6709\u4e9b\u8bf7\u6c42\u662f\u4e0d\u9700\u8981\u7ecf\u8fc7\u540e\u53f0\u5904\u7406\u7684\uff08\u5982\uff1acss\u3001html\u3001jpg\u3001js \u7b49\u7b49\u6587\u4ef6\uff09\uff0c\u8fd9\u4e9b\u4e0d\u9700\u8981\u7ecf\u8fc7\u540e\u53f0\u5904\u7406\u7684\u6587\u4ef6\u79f0\u4e3a\u9759\u6001\u6587\u4ef6\uff0c\u5426\u5219\u52a8\u6001\u6587\u4ef6\u3002<\/p>\n<blockquote style=\"font-size: 0.9em; overflow: auto; background: rgba(0, 0, 0, 0.05); margin-bottom: 20px; margin-top: 20px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; line-height: 1.8; color: #888888; border: initial none initial;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><p><span style=\"color: #555555; font-size: 4em; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201c<\/span><\/p>\n<p style=\"font-size: 16px; padding-top: 8px; padding-bottom: 8px; color: black; line-height: 26px; display: inline;\">\u56e0\u6b64\u6211\u4eec\u540e\u53f0\u5904\u7406\u5ffd\u7565\u9759\u6001\u6587\u4ef6\u3002\u8fd9\u4f1a\u6709\u4eba\u53c8\u8bf4\u90a3\u6211\u540e\u53f0\u5ffd\u7565\u9759\u6001\u6587\u4ef6\u4e0d\u5c31\u5b8c\u4e86\u5417\uff1f\u5f53\u7136\u8fd9\u662f\u53ef\u4ee5\u7684\uff0c\u4f46\u662f\u8fd9\u6837\u540e\u53f0\u7684\u8bf7\u6c42\u6b21\u6570\u5c31\u660e\u663e\u589e\u591a\u4e86\u3002\u5728\u6211\u4eec\u5bf9\u8d44\u6e90\u7684\u54cd\u5e94\u901f\u5ea6\u6709\u8981\u6c42\u7684\u65f6\u5019\uff0c\u6211\u4eec\u5e94\u8be5\u4f7f\u7528\u8fd9\u79cd\u52a8\u9759\u5206\u79bb\u7684\u7b56\u7565\u53bb\u89e3\u51b3\u52a8\u3001\u9759\u5206\u79bb\u5c06\u7f51\u7ad9\u9759\u6001\u8d44\u6e90\uff08HTML\uff0cJavaScript\uff0cCSS\uff0cimg \u7b49\u6587\u4ef6\uff09\u4e0e\u540e\u53f0\u5e94\u7528\u5206\u5f00\u90e8\u7f72\uff0c\u63d0\u9ad8\u7528\u6237\u8bbf\u95ee\u9759\u6001\u4ee3\u7801\u7684\u901f\u5ea6\uff0c\u964d\u4f4e\u5bf9\u540e\u53f0\u5e94\u7528\u8bbf\u95ee<\/p>\n<\/blockquote>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u8fd9\u91cc\u6211\u4eec\u5c06\u9759\u6001\u8d44\u6e90\u653e\u5230 Nginx \u4e2d\uff0c\u52a8\u6001\u8d44\u6e90\u8f6c\u53d1\u5230 Tomcat \u670d\u52a1\u5668\u4e2d\u53bb\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5f53\u7136\uff0c\u56e0\u4e3a\u73b0\u5728\u4e03\u725b\u3001\u963f\u91cc\u4e91\u7b49 CDN \u670d\u52a1\u5df2\u7ecf\u5f88\u6210\u719f\uff0c\u4e3b\u6d41\u7684\u505a\u6cd5\uff0c\u662f\u628a\u9759\u6001\u8d44\u6e90\u7f13\u5b58\u5230 CDN \u670d\u52a1\u4e2d\uff0c\u4ece\u800c\u63d0\u5347\u8bbf\u95ee\u901f\u5ea6\u3002<\/p>\n<blockquote style=\"font-size: 0.9em; overflow: auto; background: rgba(0, 0, 0, 0.05); margin-bottom: 20px; margin-top: 20px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; line-height: 1.8; color: #888888; border: initial none initial;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><p><span style=\"color: #555555; font-size: 4em; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201c<\/span><\/p>\n<p style=\"font-size: 16px; padding-top: 8px; padding-bottom: 8px; color: black; line-height: 26px; display: inline;\">\u76f8\u6bd4\u672c\u5730\u7684 Nginx \u6765\u8bf4\uff0cCDN \u670d\u52a1\u5668\u7531\u4e8e\u5728\u56fd\u5185\u6709\u66f4\u591a\u7684\u8282\u70b9\uff0c\u53ef\u4ee5\u5b9e\u73b0\u7528\u6237\u7684\u5c31\u8fd1\u8bbf\u95ee\u3002\u5e76\u4e14\uff0cCDN \u670d\u52a1\u53ef\u4ee5\u63d0\u4f9b\u66f4\u5927\u7684\u5e26\u5bbd\uff0c\u4e0d\u50cf\u6211\u4eec\u81ea\u5df1\u7684\u5e94\u7528\u670d\u52a1\uff0c\u63d0\u4f9b\u7684\u5e26\u5bbd\u662f\u6709\u9650\u7684\u3002<\/p>\n<\/blockquote>\n<h2 style=\"margin-top: 30px; font-weight: bold; font-size: 22px; border-bottom: 2px solid #595959; margin-bottom: 30px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"display: inline-block; border-bottom: 2px solid #595959;\"><strong style=\"color: #47c1a8;\">\u4ec0\u4e48\u53eb CDN \u670d\u52a1\uff1f<\/strong><\/span><\/h2>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">CDN \uff0c\u5373\u5185\u5bb9\u5206\u53d1\u7f51\u7edc\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5176\u76ee\u7684\u662f\uff0c\u901a\u8fc7\u5728\u73b0\u6709\u7684 Internet \u4e2d \u589e\u52a0\u4e00\u5c42\u65b0\u7684\u7f51\u7edc\u67b6\u6784\uff0c\u5c06\u7f51\u7ad9\u7684\u5185\u5bb9\u53d1\u5e03\u5230\u6700\u63a5\u8fd1\u7528\u6237\u7684\u7f51\u7edc\u8fb9\u7f18\uff0c\u4f7f\u7528\u6237\u53ef\u5c31\u8fd1\u53d6\u5f97\u6240\u9700\u7684\u5185\u5bb9\uff0c\u63d0\u9ad8\u7528\u6237\u8bbf\u95ee\u7f51\u7ad9\u7684\u901f\u5ea6\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u4e00\u822c\u6765\u8bf4\uff0c\u56e0\u4e3a\u73b0\u5728 CDN \u670d\u52a1\u6bd4\u8f83\u5927\u4f17\uff0c\u6240\u4ee5\u57fa\u672c\u6240\u6709\u516c\u53f8\u90fd\u4f1a\u4f7f\u7528 CDN \u670d\u52a1\u3002<\/p>\n<h2 style=\"margin-top: 30px; font-weight: bold; font-size: 22px; border-bottom: 2px solid #595959; margin-bottom: 30px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"display: inline-block; border-bottom: 2px solid #595959;\"><strong style=\"color: #47c1a8;\">Nginx \u600e\u4e48\u505a\u7684\u52a8\u9759\u5206\u79bb\uff1f<\/strong><\/span><\/h2>\n<blockquote style=\"font-size: 0.9em; overflow: auto; background: rgba(0, 0, 0, 0.05); margin-bottom: 20px; margin-top: 20px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; line-height: 1.8; color: #888888; border: initial none initial;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><p><span style=\"color: #555555; font-size: 4em; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201c<\/span><\/p>\n<p style=\"font-size: 16px; padding-top: 8px; padding-bottom: 8px; color: black; line-height: 26px; display: inline;\">\u53ea\u9700\u8981\u6307\u5b9a\u8def\u5f84\u5bf9\u5e94\u7684\u76ee\u5f55\u3002location \/ \u53ef\u4ee5\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u5339\u914d\u3002\u5e76\u6307\u5b9a\u5bf9\u5e94\u7684\u786c\u76d8\u4e2d\u7684\u76ee\u5f55\u3002\u5982\u4e0b\uff1a\uff08\u64cd\u4f5c\u90fd\u662f\u5728 Linux \u4e0a\uff09<\/p>\n<\/blockquote>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\">location\u00a0\/image\/\u00a0{\n\u00a0\u00a0\u00a0\u00a0root\u00a0\/usr\/<span style=\"color: #e6c07b; line-height: 26px;\">local<\/span>\/static\/;\n\u00a0\u00a0\u00a0\u00a0autoindex\u00a0on;\n}\n\u6b65\u9aa4\uff1a\n<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u521b\u5efa\u76ee\u5f55<\/span>\nmkdir\u00a0\/usr\/<span style=\"color: #e6c07b; line-height: 26px;\">local<\/span>\/static\/image\n\u00a0\n<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u8fdb\u5165\u76ee\u5f55<\/span>\n<span style=\"color: #e6c07b; line-height: 26px;\">cd<\/span>\u00a0\u00a0\/usr\/<span style=\"color: #e6c07b; line-height: 26px;\">local<\/span>\/static\/image\n\u00a0\n<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u4e0a\u4f20\u7167\u7247<\/span>\nphoto.jpg\n\u00a0\n<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u91cd\u542fnginx<\/span>\nsudo\u00a0nginx\u00a0-s\u00a0reload\n<\/code><\/pre>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u6253\u5f00\u6d4f\u89c8\u5668 \u8f93\u5165\u00a0server_name\/image\/1.jpg\u00a0\u5c31\u53ef\u4ee5\u8bbf\u95ee\u8be5\u9759\u6001\u56fe\u7247\u4e86<\/p>\n<h2 style=\"margin-top: 30px; font-weight: bold; font-size: 22px; border-bottom: 2px solid #595959; margin-bottom: 30px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"display: inline-block; border-bottom: 2px solid #595959;\"><strong style=\"color: #47c1a8;\">Nginx \u8d1f\u8f7d\u5747\u8861\u7684\u7b97\u6cd5\u600e\u4e48\u5b9e\u73b0\u7684? \u7b56\u7565\u6709\u54ea\u4e9b?<\/strong><\/span><\/h2>\n<blockquote style=\"font-size: 0.9em; overflow: auto; background: rgba(0, 0, 0, 0.05); margin-bottom: 20px; margin-top: 20px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; line-height: 1.8; color: #888888; border: initial none initial;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><p><span style=\"color: #555555; font-size: 4em; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201c<\/span><\/p>\n<p style=\"font-size: 16px; padding-top: 8px; padding-bottom: 8px; color: black; line-height: 26px; display: inline;\">\u4e3a\u4e86\u907f\u514d\u670d\u52a1\u5668\u5d29\u6e83\uff0c\u5927\u5bb6\u4f1a\u901a\u8fc7\u8d1f\u8f7d\u5747\u8861\u7684\u65b9\u5f0f\u6765\u5206\u62c5\u670d\u52a1\u5668\u538b\u529b\u3002\u5c06\u5bf9\u53f0\u670d\u52a1\u5668\u7ec4\u6210\u4e00\u4e2a\u96c6\u7fa4\uff0c\u5f53\u7528\u6237\u8bbf\u95ee\u65f6\uff0c\u5148\u8bbf\u95ee\u5230\u4e00\u4e2a\u8f6c\u53d1\u670d\u52a1\u5668\uff0c\u518d\u7531\u8f6c\u53d1\u670d\u52a1\u5668\u5c06\u8bbf\u95ee\u5206\u53d1\u5230\u538b\u529b\u66f4\u5c0f\u7684\u670d\u52a1\u5668\u3002<\/p>\n<\/blockquote>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">Nginx \u8d1f\u8f7d\u5747\u8861\u5b9e\u73b0\u7684\u7b56\u7565\u6709\u4ee5\u4e0b\u4e94\u79cd\uff1a<\/p>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 18px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">1 . \u8f6e\u8be2 (\u9ed8\u8ba4)<\/h4>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\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\u67d0\u4e2a\u670d\u52a1\u5668\u5b95\u673a\uff0c\u80fd\u81ea\u52a8\u5254\u9664\u6545\u969c\u7cfb\u7edf\u3002<\/p>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\">upstream\u00a0backserver\u00a0{\n\u00a0server\u00a0192.168.0.12;\n\u00a0server\u00a0192.168.0.13;\n}\n<\/code><\/pre>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 18px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">2. \u6743\u91cd weight<\/h4>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">weight \u7684\u503c\u8d8a\u5927\uff0c\u5206\u914d\u5230\u7684\u8bbf\u95ee\u6982\u7387\u8d8a\u9ad8\uff0c\u4e3b\u8981\u7528\u4e8e\u540e\u7aef\u6bcf\u53f0\u670d\u52a1\u5668\u6027\u80fd\u4e0d\u5747\u8861\u7684\u60c5\u51b5\u4e0b\u3002\u5176\u6b21\u662f\u4e3a\u5728\u4e3b\u4ece\u7684\u60c5\u51b5\u4e0b\u8bbe\u7f6e\u4e0d\u540c\u7684\u6743\u503c\uff0c\u8fbe\u5230\u5408\u7406\u6709\u6548\u7684\u5730\u5229\u7528\u4e3b\u673a\u8d44\u6e90\u3002<\/p>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\"><span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u6743\u91cd\u8d8a\u9ad8\uff0c\u5728\u88ab\u8bbf\u95ee\u7684\u6982\u7387\u8d8a\u5927\uff0c\u5982\u4e0a\u4f8b\uff0c\u5206\u522b\u662f20%\uff0c80%\u3002<\/span>\nupstream\u00a0backserver\u00a0{\n\u00a0server\u00a0192.168.0.12\u00a0weight=2;\n\u00a0server\u00a0192.168.0.13\u00a0weight=8;\n}\n<\/code><\/pre>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 18px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">3. ip_hash(IP \u7ed1\u5b9a)<\/h4>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u6bcf\u4e2a\u8bf7\u6c42\u6309\u8bbf\u95ee IP \u7684\u54c8\u5e0c\u7ed3\u679c\u5206\u914d\uff0c\u4f7f\u6765\u81ea\u540c\u4e00\u4e2a IP \u7684\u8bbf\u5ba2\u56fa\u5b9a\u8bbf\u95ee\u4e00\u53f0\u540e\u7aef\u670d\u52a1\u5668\uff0c\u5e76\u4e14\u53ef\u4ee5\u6709\u6548\u89e3\u51b3\u52a8\u6001\u7f51\u9875\u5b58\u5728\u7684 session \u5171\u4eab\u95ee\u9898<\/p>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\">upstream\u00a0backserver\u00a0{\n\u00a0ip_hash;\n\u00a0server\u00a0192.168.0.12:88;\n\u00a0server\u00a0192.168.0.13:80;\n}\n<\/code><\/pre>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 18px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">4. fair(\u7b2c\u4e09\u65b9\u63d2\u4ef6)<\/h4>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5fc5\u987b\u5b89\u88c5 upstream_fair \u6a21\u5757\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5bf9\u6bd4 weight\u3001ip_hash \u66f4\u52a0\u667a\u80fd\u7684\u8d1f\u8f7d\u5747\u8861\u7b97\u6cd5\uff0cfair \u7b97\u6cd5\u53ef\u4ee5\u6839\u636e\u9875\u9762\u5927\u5c0f\u548c\u52a0\u8f7d\u65f6\u95f4\u957f\u77ed\u667a\u80fd\u5730\u8fdb\u884c\u8d1f\u8f7d\u5747\u8861\uff0c\u54cd\u5e94\u65f6\u95f4\u77ed\u7684\u4f18\u5148\u5206\u914d\u3002<\/p>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\"><span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u54ea\u4e2a\u670d\u52a1\u5668\u7684\u54cd\u5e94\u901f\u5ea6\u5feb\uff0c\u5c31\u5c06\u8bf7\u6c42\u5206\u914d\u5230\u90a3\u4e2a\u670d\u52a1\u5668\u4e0a\u3002<\/span>\nupstream\u00a0backserver\u00a0{\n\u00a0server\u00a0server1;\n\u00a0server\u00a0server2;\n\u00a0fair;\n}\n<\/code><\/pre>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">5.url_hash(\u7b2c\u4e09\u65b9\u63d2\u4ef6)<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5fc5\u987b\u5b89\u88c5 Nginx \u7684 hash \u8f6f\u4ef6\u5305<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u6309\u8bbf\u95ee url \u7684 hash \u7ed3\u679c\u6765\u5206\u914d\u8bf7\u6c42\uff0c\u4f7f\u6bcf\u4e2a url \u5b9a\u5411\u5230\u540c\u4e00\u4e2a\u540e\u7aef\u670d\u52a1\u5668\uff0c\u53ef\u4ee5\u8fdb\u4e00\u6b65\u63d0\u9ad8\u540e\u7aef\u7f13\u5b58\u670d\u52a1\u5668\u7684\u6548\u7387\u3002<\/p>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\">upstream\u00a0backserver\u00a0{\n\u00a0server\u00a0squid1:3128;\n\u00a0server\u00a0squid2:3128;\n\u00a0<span style=\"color: #e6c07b; line-height: 26px;\">hash<\/span>\u00a0<span style=\"color: #d19a66; line-height: 26px;\">$request_uri<\/span>;\n\u00a0hash_method\u00a0crc32;\n}\n<\/code><\/pre>\n<h2 style=\"margin-top: 30px; font-weight: bold; font-size: 22px; border-bottom: 2px solid #595959; margin-bottom: 30px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"display: inline-block; border-bottom: 2px solid #595959;\"><strong style=\"color: #47c1a8;\">\u5982\u4f55\u7528 Nginx \u89e3\u51b3\u524d\u7aef\u8de8\u57df\u95ee\u9898\uff1f<\/strong><\/span><\/h2>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u4f7f\u7528 Nginx \u8f6c\u53d1\u8bf7\u6c42\u3002\u628a\u8de8\u57df\u7684\u63a5\u53e3\u5199\u6210\u8c03\u672c\u57df\u7684\u63a5\u53e3\uff0c\u7136\u540e\u5c06\u8fd9\u4e9b\u63a5\u53e3\u8f6c\u53d1\u5230\u771f\u6b63\u7684\u8bf7\u6c42\u5730\u5740\u3002<\/p>\n<h2 style=\"margin-top: 30px; font-weight: bold; font-size: 22px; border-bottom: 2px solid #595959; margin-bottom: 30px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"display: inline-block; border-bottom: 2px solid #595959;\"><strong style=\"color: #47c1a8;\">Nginx \u865a\u62df\u4e3b\u673a\u600e\u4e48\u914d\u7f6e?<\/strong><\/span><\/h2>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">1\u3001\u57fa\u4e8e\u57df\u540d\u7684\u865a\u62df\u4e3b\u673a\uff0c\u901a\u8fc7\u57df\u540d\u6765\u533a\u5206\u865a\u62df\u4e3b\u673a\u2014\u2014\u5e94\u7528\uff1a\u5916\u90e8\u7f51\u7ad9<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">2\u3001\u57fa\u4e8e\u7aef\u53e3\u7684\u865a\u62df\u4e3b\u673a\uff0c\u901a\u8fc7\u7aef\u53e3\u6765\u533a\u5206\u865a\u62df\u4e3b\u673a\u2014\u2014\u5e94\u7528\uff1a\u516c\u53f8\u5185\u90e8\u7f51\u7ad9\uff0c\u5916\u90e8\u7f51\u7ad9\u7684\u7ba1\u7406\u540e\u53f0<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">3\u3001\u57fa\u4e8e ip \u7684\u865a\u62df\u4e3b\u673a\u3002<\/p>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 18px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u57fa\u4e8e\u865a\u62df\u4e3b\u673a\u914d\u7f6e\u57df\u540d<\/h4>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u9700\u8981\u5efa\u7acb \/ data\/www \/data\/bbs \u76ee\u5f55\uff0cwindows \u672c\u5730 hosts \u6dfb\u52a0\u865a\u62df\u673a ip \u5730\u5740\u5bf9\u5e94\u7684\u57df\u540d\u89e3\u6790\uff1b\u5bf9\u5e94\u57df\u540d\u7f51\u7ad9\u76ee\u5f55\u4e0b\u65b0\u589e index.html \u6587\u4ef6\uff1b<\/p>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\"><span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u5f53\u5ba2\u6237\u7aef\u8bbf\u95eewww.lijie.com,\u76d1\u542c\u7aef\u53e3\u53f7\u4e3a80,\u76f4\u63a5\u8df3\u8f6c\u5230data\/www\u76ee\u5f55\u4e0b\u6587\u4ef6<\/span>\nserver\u00a0{\n\u00a0\u00a0\u00a0\u00a0listen\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a080;\n\u00a0\u00a0\u00a0\u00a0server_name\u00a0\u00a0www.lijie.com;\n\u00a0\u00a0\u00a0\u00a0location\u00a0\/\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0root\u00a0\u00a0\u00a0data\/www;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0index\u00a0\u00a0index.html\u00a0index.htm;\n\u00a0\u00a0\u00a0\u00a0}\n}\n\n<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u5f53\u5ba2\u6237\u7aef\u8bbf\u95eewww.lijie.com,\u76d1\u542c\u7aef\u53e3\u53f7\u4e3a80,\u76f4\u63a5\u8df3\u8f6c\u5230data\/bbs\u76ee\u5f55\u4e0b\u6587\u4ef6<\/span>\n\u00a0server\u00a0{\n\u00a0\u00a0\u00a0\u00a0listen\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a080;\n\u00a0\u00a0\u00a0\u00a0server_name\u00a0\u00a0bbs.lijie.com;\n\u00a0\u00a0\u00a0\u00a0location\u00a0\/\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0root\u00a0\u00a0\u00a0data\/bbs;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0index\u00a0\u00a0index.html\u00a0index.htm;\n\u00a0\u00a0\u00a0\u00a0}\n}\n<\/code><\/pre>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 18px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u57fa\u4e8e\u7aef\u53e3\u7684\u865a\u62df\u4e3b\u673a<\/h4>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u4f7f\u7528\u7aef\u53e3\u6765\u533a\u5206\uff0c\u6d4f\u89c8\u5668\u4f7f\u7528\u57df\u540d\u6216 ip \u5730\u5740: \u7aef\u53e3\u53f7 \u8bbf\u95ee<\/p>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\"><span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u5f53\u5ba2\u6237\u7aef\u8bbf\u95eewww.lijie.com,\u76d1\u542c\u7aef\u53e3\u53f7\u4e3a8080,\u76f4\u63a5\u8df3\u8f6c\u5230data\/www\u76ee\u5f55\u4e0b\u6587\u4ef6<\/span>\n\u00a0server\u00a0{\n\u00a0\u00a0\u00a0\u00a0listen\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a08080;\n\u00a0\u00a0\u00a0\u00a0server_name\u00a0\u00a08080.lijie.com;\n\u00a0\u00a0\u00a0\u00a0location\u00a0\/\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0root\u00a0\u00a0\u00a0data\/www;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0index\u00a0\u00a0index.html\u00a0index.htm;\n\u00a0\u00a0\u00a0\u00a0}\n}\n\n<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u5f53\u5ba2\u6237\u7aef\u8bbf\u95eewww.lijie.com,\u76d1\u542c\u7aef\u53e3\u53f7\u4e3a80\u76f4\u63a5\u8df3\u8f6c\u5230\u771f\u5b9eip\u670d\u52a1\u5668\u5730\u5740\u00a0127.0.0.1:8080<\/span>\nserver\u00a0{\n\u00a0\u00a0\u00a0\u00a0listen\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a080;\n\u00a0\u00a0\u00a0\u00a0server_name\u00a0\u00a0www.lijie.com;\n\u00a0\u00a0\u00a0\u00a0location\u00a0\/\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0proxy_pass\u00a0http:\/\/127.0.0.1:8080;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0index\u00a0\u00a0index.html\u00a0index.htm;\n\u00a0\u00a0\u00a0\u00a0}\n}\n<\/code><\/pre>\n<h2 style=\"margin-top: 30px; font-weight: bold; font-size: 22px; border-bottom: 2px solid #595959; margin-bottom: 30px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"display: inline-block; border-bottom: 2px solid #595959;\"><strong style=\"color: #47c1a8;\">location \u7684\u4f5c\u7528\u662f\u4ec0\u4e48\uff1f<\/strong><\/span><\/h2>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">location \u6307\u4ee4\u7684\u4f5c\u7528\u662f\u6839\u636e\u7528\u6237\u8bf7\u6c42\u7684 URI \u6765\u6267\u884c\u4e0d\u540c\u7684\u5e94\u7528\uff0c\u4e5f\u5c31\u662f\u6839\u636e\u7528\u6237\u8bf7\u6c42\u7684\u7f51\u7ad9 URL \u8fdb\u884c\u5339\u914d\uff0c\u5339\u914d\u6210\u529f\u5373\u8fdb\u884c\u76f8\u5173\u7684\u64cd\u4f5c\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">location \u7684\u8bed\u6cd5\u80fd\u8bf4\u51fa\u6765\u5417\uff1f<\/p>\n<blockquote style=\"font-size: 0.9em; overflow: auto; background: rgba(0, 0, 0, 0.05); margin-bottom: 20px; margin-top: 20px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; line-height: 1.8; color: #888888; border: initial none initial;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><p><span style=\"color: #555555; font-size: 4em; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201c<\/span><\/p>\n<p style=\"font-size: 16px; padding-top: 8px; padding-bottom: 8px; color: black; line-height: 26px; display: inline;\">\u6ce8\u610f\uff1a~ \u4ee3\u8868\u81ea\u5df1\u8f93\u5165\u7684\u82f1\u6587\u5b57\u6bcd<\/p>\n<\/blockquote>\n<figure style=\"margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-src=\"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201107406.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-ratio=\"0.3509259259259259\" data-data-src=\"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201107406.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-w=\"1080\" \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" src=\"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201107406.png\" data-ratio=\"0.3509259259259259\" data-src=\"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201107406.png\" data-w=\"1080\" \/><\/noscript><\/figure>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">Location \u6b63\u5219\u6848\u4f8b<\/p>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\"><span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u4f18\u5148\u7ea71,\u7cbe\u786e\u5339\u914d\uff0c\u6839\u8def\u5f84<\/span>\nlocation\u00a0=\/\u00a0{\n\u00a0\u00a0\u00a0\u00a0<span style=\"color: #e6c07b; line-height: 26px;\">return<\/span>\u00a0400;\n}\n\n<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u4f18\u5148\u7ea72,\u4ee5\u67d0\u4e2a\u5b57\u7b26\u4e32\u5f00\u5934,\u4ee5av\u5f00\u5934\u7684\uff0c\u4f18\u5148\u5339\u914d\u8fd9\u91cc\uff0c\u533a\u5206\u5927\u5c0f\u5199<\/span>\nlocation\u00a0^~\u00a0\/av\u00a0{\n\u00a0\u00a0\u00a0root\u00a0\/data\/av\/;\n}\n\n<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u4f18\u5148\u7ea73\uff0c\u533a\u5206\u5927\u5c0f\u5199\u7684\u6b63\u5219\u5339\u914d\uff0c\u5339\u914d\/media*****\u8def\u5f84<\/span>\nlocation\u00a0~\u00a0\/media\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #e6c07b; line-height: 26px;\">alias<\/span>\u00a0\/data\/static\/;\n}\n\n<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u4f18\u5148\u7ea74\u00a0\uff0c\u4e0d\u533a\u5206\u5927\u5c0f\u5199\u7684\u6b63\u5219\u5339\u914d\uff0c\u6240\u6709\u7684****.jpg|gif|png\u00a0\u90fd\u8d70\u8fd9\u91cc<\/span>\nlocation\u00a0~*\u00a0.*.(jpg|gif|png|js|css)<\/code><\/pre>\n<pre><\/pre>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\">nbsp;{\n\u00a0\u00a0\u00a0root\u00a0\u00a0\/data\/av\/;\n}\n\n<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u4f18\u51487\uff0c\u901a\u7528\u5339\u914d<\/span>\nlocation\u00a0\/\u00a0{\n\u00a0\u00a0\u00a0\u00a0<span style=\"color: #e6c07b; line-height: 26px;\">return<\/span>\u00a0403;\n}\n<\/code><\/pre>\n<h2 style=\"margin-top: 30px; font-weight: bold; font-size: 22px; border-bottom: 2px solid #595959; margin-bottom: 30px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"display: inline-block; border-bottom: 2px solid #595959;\"><strong style=\"color: #47c1a8;\">\u9650\u6d41\u600e\u4e48\u505a\u7684\uff1f<\/strong><\/span><\/h2>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">Nginx \u9650\u6d41\u5c31\u662f\u9650\u5236\u7528\u6237\u8bf7\u6c42\u901f\u5ea6\uff0c\u9632\u6b62\u670d\u52a1\u5668\u53d7\u4e0d\u4e86<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u9650\u6d41\u6709 3 \u79cd<\/p>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\">\u6b63\u5e38\u9650\u5236\u8bbf\u95ee\u9891\u7387\uff08\u6b63\u5e38\u6d41\u91cf\uff09<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\">\u7a81\u53d1\u9650\u5236\u8bbf\u95ee\u9891\u7387\uff08\u7a81\u53d1\u6d41\u91cf\uff09<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\">\u9650\u5236\u5e76\u53d1\u8fde\u63a5\u6570<\/p>\n<\/section>\n<\/li>\n<\/ul>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">Nginx \u7684\u9650\u6d41\u90fd\u662f\u57fa\u4e8e\u6f0f\u6876\u6d41\u7b97\u6cd5<\/p>\n<blockquote style=\"font-size: 0.9em; overflow: auto; background: rgba(0, 0, 0, 0.05); margin-bottom: 20px; margin-top: 20px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; line-height: 1.8; color: #888888; border: initial none initial;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><p><span style=\"color: #555555; font-size: 4em; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201c<\/span><\/p>\n<p style=\"font-size: 16px; padding-top: 8px; padding-bottom: 8px; color: black; line-height: 26px; display: inline;\">\u5b9e\u73b0\u4e09\u79cd\u9650\u6d41\u7b97\u6cd5<\/p>\n<\/blockquote>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 18px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">1\u3001\u6b63\u5e38\u9650\u5236\u8bbf\u95ee\u9891\u7387\uff08\u6b63\u5e38\u6d41\u91cf\uff09\uff1a<\/h4>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u9650\u5236\u4e00\u4e2a\u7528\u6237\u53d1\u9001\u7684\u8bf7\u6c42\uff0c\u6211 Nginx \u591a\u4e45\u63a5\u6536\u4e00\u4e2a\u8bf7\u6c42\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">Nginx \u4e2d\u4f7f\u7528 ngx_http_limit_req_module \u6a21\u5757\u6765\u9650\u5236\u7684\u8bbf\u95ee\u9891\u7387\uff0c\u9650\u5236\u7684\u539f\u7406\u5b9e\u8d28\u662f\u57fa\u4e8e\u6f0f\u6876\u7b97\u6cd5\u539f\u7406\u6765\u5b9e\u73b0\u7684\u3002\u5728 nginx.conf \u914d\u7f6e\u6587\u4ef6\u4e2d\u53ef\u4ee5\u4f7f\u7528 limit_req_zone \u547d\u4ee4\u53ca limit_req \u547d\u4ee4\u9650\u5236\u5355\u4e2a IP \u7684\u8bf7\u6c42\u5904\u7406\u9891\u7387\u3002<\/p>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\"><span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u5b9a\u4e49\u9650\u6d41\u7ef4\u5ea6\uff0c\u4e00\u4e2a\u7528\u6237\u4e00\u5206\u949f\u4e00\u4e2a\u8bf7\u6c42\u8fdb\u6765\uff0c\u591a\u4f59\u7684\u5168\u90e8\u6f0f\u6389<\/span>\nlimit_req_zone\u00a0<span style=\"color: #d19a66; line-height: 26px;\">$binary_remote_addr<\/span>\u00a0zone=one:10m\u00a0rate=1r\/m;\n\n<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u7ed1\u5b9a\u9650\u6d41\u7ef4\u5ea6<\/span>\nserver{\n\u00a0\u00a0\u00a0\u00a0\n\u00a0\u00a0\u00a0\u00a0location\/seckill.html{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0limit_req\u00a0zone=zone;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0proxy_pass\u00a0http:\/\/lj_seckill;\n\u00a0\u00a0\u00a0\u00a0}\n\n}\n<\/code><\/pre>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">1r\/s \u4ee3\u8868 1 \u79d2\u4e00\u4e2a\u8bf7\u6c42\uff0c1r\/m \u4e00\u5206\u949f\u63a5\u6536\u4e00\u4e2a\u8bf7\u6c42\uff0c \u5982\u679c Nginx \u8fd9\u65f6\u8fd8\u6709\u522b\u4eba\u7684\u8bf7\u6c42\u6ca1\u6709\u5904\u7406\u5b8c\uff0cNginx \u5c31\u4f1a\u62d2\u7edd\u5904\u7406\u8be5\u7528\u6237\u8bf7\u6c42\u3002<\/p>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 18px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">2\u3001\u7a81\u53d1\u9650\u5236\u8bbf\u95ee\u9891\u7387\uff08\u7a81\u53d1\u6d41\u91cf\uff09\uff1a<\/h4>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u9650\u5236\u4e00\u4e2a\u7528\u6237\u53d1\u9001\u7684\u8bf7\u6c42\uff0c\u6211 Nginx \u591a\u4e45\u63a5\u6536\u4e00\u4e2a\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u4e0a\u9762\u7684\u914d\u7f6e\u4e00\u5b9a\u7a0b\u5ea6\u53ef\u4ee5\u9650\u5236\u8bbf\u95ee\u9891\u7387\uff0c\u4f46\u662f\u4e5f\u5b58\u5728\u7740\u4e00\u4e2a\u95ee\u9898\uff1a\u5982\u679c\u7a81\u53d1\u6d41\u91cf\u8d85\u51fa\u8bf7\u6c42\u88ab\u62d2\u7edd\u5904\u7406\uff0c\u65e0\u6cd5\u5904\u7406\u6d3b\u52a8\u65f6\u5019\u7684\u7a81\u53d1\u6d41\u91cf\uff0c\u8fd9\u65f6\u5019\u5e94\u8be5\u5982\u4f55\u8fdb\u4e00\u6b65\u5904\u7406\u5462\uff1f<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">Nginx \u63d0\u4f9b burst \u53c2\u6570\u7ed3\u5408 nodelay \u53c2\u6570\u53ef\u4ee5\u89e3\u51b3\u6d41\u91cf\u7a81\u53d1\u7684\u95ee\u9898\uff0c\u53ef\u4ee5\u8bbe\u7f6e\u80fd\u5904\u7406\u7684\u8d85\u8fc7\u8bbe\u7f6e\u7684\u8bf7\u6c42\u6570\u5916\u80fd\u989d\u5916\u5904\u7406\u7684\u8bf7\u6c42\u6570\u3002\u6211\u4eec\u53ef\u4ee5\u5c06\u4e4b\u524d\u7684\u4f8b\u5b50\u6dfb\u52a0 burst \u53c2\u6570\u4ee5\u53ca nodelay \u53c2\u6570\uff1a<\/p>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\"><span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u5b9a\u4e49\u9650\u6d41\u7ef4\u5ea6\uff0c\u4e00\u4e2a\u7528\u6237\u4e00\u5206\u949f\u4e00\u4e2a\u8bf7\u6c42\u8fdb\u6765\uff0c\u591a\u4f59\u7684\u5168\u90e8\u6f0f\u6389<\/span>\nlimit_req_zone\u00a0<span style=\"color: #d19a66; line-height: 26px;\">$binary_remote_addr<\/span>\u00a0zone=one:10m\u00a0rate=1r\/m;\n\n<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u7ed1\u5b9a\u9650\u6d41\u7ef4\u5ea6<\/span>\nserver{\n\u00a0\u00a0\u00a0\u00a0\n\u00a0\u00a0\u00a0\u00a0location\/seckill.html{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0limit_req\u00a0zone=zone\u00a0burst=5\u00a0nodelay;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0proxy_pass\u00a0http:\/\/lj_seckill;\n\u00a0\u00a0\u00a0\u00a0}\n\n}\n<\/code><\/pre>\n<blockquote style=\"font-size: 0.9em; overflow: auto; background: rgba(0, 0, 0, 0.05); margin-bottom: 20px; margin-top: 20px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; line-height: 1.8; color: #888888; border: initial none initial;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><p><span style=\"color: #555555; font-size: 4em; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201c<\/span><\/p>\n<p style=\"font-size: 16px; padding-top: 8px; padding-bottom: 8px; color: black; line-height: 26px; display: inline;\">\u4e3a\u4ec0\u4e48\u5c31\u591a\u4e86\u4e00\u4e2a burst=5 nodelay; \u5462\uff0c\u591a\u4e86\u8fd9\u4e2a\u53ef\u4ee5\u4ee3\u8868 Nginx \u5bf9\u4e8e\u4e00\u4e2a\u7528\u6237\u7684\u8bf7\u6c42\u4f1a\u7acb\u5373\u5904\u7406\u524d\u4e94\u4e2a\uff0c\u591a\u4f59\u7684\u5c31\u6162\u6162\u6765\u843d\uff0c\u6ca1\u6709\u5176\u4ed6\u7528\u6237\u7684\u8bf7\u6c42\u6211\u5c31\u5904\u7406\u4f60\u7684\uff0c\u6709\u5176\u4ed6\u7684\u8bf7\u6c42\u7684\u8bdd\u6211 Nginx \u5c31\u6f0f\u6389\u4e0d\u63a5\u53d7\u4f60\u7684\u8bf7\u6c42<\/p>\n<\/blockquote>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 18px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">3\u3001 \u9650\u5236\u5e76\u53d1\u8fde\u63a5\u6570<\/h4>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">Nginx \u4e2d\u7684 ngx_http_limit_conn_module \u6a21\u5757\u63d0\u4f9b\u4e86\u9650\u5236\u5e76\u53d1\u8fde\u63a5\u6570\u7684\u529f\u80fd\uff0c\u53ef\u4ee5\u4f7f\u7528 limit_conn_zone \u6307\u4ee4\u4ee5\u53ca limit_conn \u6267\u884c\u8fdb\u884c\u914d\u7f6e\u3002\u63a5\u4e0b\u6765\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4e00\u4e2a\u7b80\u5355\u7684\u4f8b\u5b50\u6765\u770b\u4e0b\uff1a<\/p>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\">http\u00a0{\n\u00a0\u00a0\u00a0\u00a0limit_conn_zone\u00a0<span style=\"color: #d19a66; line-height: 26px;\">$binary_remote_addr<\/span>\u00a0zone=myip:10m;\n\u00a0\u00a0\u00a0\u00a0limit_conn_zone\u00a0<span style=\"color: #d19a66; line-height: 26px;\">$server_name<\/span>\u00a0zone=myServerName:10m;\n}\n\nserver\u00a0{\n\u00a0\u00a0\u00a0\u00a0location\u00a0\/\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0limit_conn\u00a0myip\u00a010;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0limit_conn\u00a0myServerName\u00a0100;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0rewrite\u00a0\/\u00a0http:\/\/www.lijie.net\u00a0permanent;\n\u00a0\u00a0\u00a0\u00a0}\n}\n<\/code><\/pre>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u4e0a\u9762\u914d\u7f6e\u4e86\u5355\u4e2a IP \u540c\u65f6\u5e76\u53d1\u8fde\u63a5\u6570\u6700\u591a\u53ea\u80fd 10 \u4e2a\u8fde\u63a5\uff0c\u5e76\u4e14\u8bbe\u7f6e\u4e86\u6574\u4e2a\u865a\u62df\u670d\u52a1\u5668\u540c\u65f6\u6700\u5927\u5e76\u53d1\u6570\u6700\u591a\u53ea\u80fd 100 \u4e2a\u94fe\u63a5\u3002\u5f53\u7136\uff0c\u53ea\u6709\u5f53\u8bf7\u6c42\u7684 header \u88ab\u670d\u52a1\u5668\u5904\u7406\u540e\uff0c\u865a\u62df\u670d\u52a1\u5668\u7684\u8fde\u63a5\u6570\u624d\u4f1a\u8ba1\u6570\u3002\u521a\u624d\u6709\u63d0\u5230\u8fc7 Nginx \u662f\u57fa\u4e8e\u6f0f\u6876\u7b97\u6cd5\u539f\u7406\u5b9e\u73b0\u7684\uff0c\u5b9e\u9645\u4e0a\u9650\u6d41\u4e00\u822c\u90fd\u662f\u57fa\u4e8e\u6f0f\u6876\u7b97\u6cd5\u548c\u4ee4\u724c\u6876\u7b97\u6cd5\u5b9e\u73b0\u7684\u3002<\/p>\n<h2 style=\"margin-top: 30px; font-weight: bold; font-size: 22px; border-bottom: 2px solid #595959; margin-bottom: 30px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"display: inline-block; border-bottom: 2px solid #595959;\">\u6f0f\u6876\u6d41\u7b97\u6cd5\u548c\u4ee4\u724c\u6876\u7b97\u6cd5\u77e5\u9053\uff1f<\/span><\/h2>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 18px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u6f0f\u6876\u7b97\u6cd5<\/h4>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u6f0f\u6876\u7b97\u6cd5\u601d\u8def\u5f88\u7b80\u5355\uff0c\u6211\u4eec\u628a\u6c34\u6bd4\u4f5c\u662f\u8bf7\u6c42\uff0c\u6f0f\u6876\u6bd4\u4f5c\u662f\u7cfb\u7edf\u5904\u7406\u80fd\u529b\u6781\u9650\uff0c\u6c34\u5148\u8fdb\u5165\u5230\u6f0f\u6876\u91cc\uff0c\u6f0f\u6876\u91cc\u7684\u6c34\u6309\u4e00\u5b9a\u901f\u7387\u6d41\u51fa\uff0c\u5f53\u6d41\u51fa\u7684\u901f\u7387\u5c0f\u4e8e\u6d41\u5165\u7684\u901f\u7387\u65f6\uff0c\u7531\u4e8e\u6f0f\u6876\u5bb9\u91cf\u6709\u9650\uff0c\u540e\u7eed\u8fdb\u5165\u7684\u6c34\u76f4\u63a5\u6ea2\u51fa\uff08\u62d2\u7edd\u8bf7\u6c42\uff09\uff0c\u4ee5\u6b64\u5b9e\u73b0\u9650\u6d41\u3002<\/p>\n<figure style=\"margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-src=\"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201109165.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-ratio=\"0.5304347826086957\" data-data-src=\"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201109165.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-w=\"920\" \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" src=\"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201109165.png\" data-ratio=\"0.5304347826086957\" data-src=\"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201109165.png\" data-w=\"920\" \/><\/noscript><\/figure>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 18px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u4ee4\u724c\u6876\u7b97\u6cd5<\/h4>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u4ee4\u724c\u6876\u7b97\u6cd5\u7684\u539f\u7406\u4e5f\u6bd4\u8f83\u7b80\u5355\uff0c\u6211\u4eec\u53ef\u4ee5\u7406\u89e3\u6210\u533b\u9662\u7684\u6302\u53f7\u770b\u75c5\uff0c\u53ea\u6709\u62ff\u5230\u53f7\u4ee5\u540e\u624d\u53ef\u4ee5\u8fdb\u884c\u8bca\u75c5\u3002<\/p>\n<blockquote style=\"font-size: 0.9em; overflow: auto; background: rgba(0, 0, 0, 0.05); margin-bottom: 20px; margin-top: 20px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; line-height: 1.8; color: #888888; border: initial none initial;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><p><span style=\"color: #555555; font-size: 4em; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201c<\/span><\/p>\n<p style=\"font-size: 16px; padding-top: 8px; padding-bottom: 8px; color: black; line-height: 26px; display: inline;\">\u7cfb\u7edf\u4f1a\u7ef4\u62a4\u4e00\u4e2a\u4ee4\u724c\uff08token\uff09\u6876\uff0c\u4ee5\u4e00\u4e2a\u6052\u5b9a\u7684\u901f\u5ea6\u5f80\u6876\u91cc\u653e\u5165\u4ee4\u724c\uff08token\uff09\uff0c\u8fd9\u65f6\u5982\u679c\u6709\u8bf7\u6c42\u8fdb\u6765\u60f3\u8981\u88ab\u5904\u7406\uff0c\u5219\u9700\u8981\u5148\u4ece\u6876\u91cc\u83b7\u53d6\u4e00\u4e2a\u4ee4\u724c\uff08token\uff09\uff0c\u5f53\u6876\u91cc\u6ca1\u6709\u4ee4\u724c\uff08token\uff09\u53ef\u53d6\u65f6\uff0c\u5219\u8be5\u8bf7\u6c42\u5c06\u88ab\u62d2\u7edd\u670d\u52a1\u3002\u4ee4\u724c\u6876\u7b97\u6cd5\u901a\u8fc7\u63a7\u5236\u6876\u7684\u5bb9\u91cf\u3001\u53d1\u653e\u4ee4\u724c\u7684\u901f\u7387\uff0c\u6765\u8fbe\u5230\u5bf9\u8bf7\u6c42\u7684\u9650\u5236\u3002<\/p>\n<\/blockquote>\n<figure style=\"margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-src=\"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201113550.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-ratio=\"0.5291750503018109\" data-data-src=\"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201113550.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-w=\"994\" \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" src=\"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201113550.png\" data-ratio=\"0.5291750503018109\" data-src=\"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201113550.png\" data-w=\"994\" \/><\/noscript><\/figure>\n<h2 style=\"margin-top: 30px; font-weight: bold; font-size: 22px; border-bottom: 2px solid #595959; margin-bottom: 30px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"display: inline-block; border-bottom: 2px solid #595959;\"><strong style=\"color: #47c1a8;\">Nginx \u914d\u7f6e\u9ad8\u53ef\u7528\u6027\u600e\u4e48\u914d\u7f6e\uff1f<\/strong><\/span><\/h2>\n<blockquote style=\"font-size: 0.9em; overflow: auto; background: rgba(0, 0, 0, 0.05); margin-bottom: 20px; margin-top: 20px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; line-height: 1.8; color: #888888; border: initial none initial;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><p><span style=\"color: #555555; font-size: 4em; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201c<\/span><\/p>\n<p style=\"font-size: 16px; padding-top: 8px; padding-bottom: 8px; color: black; line-height: 26px; display: inline;\">\u5f53\u4e0a\u6e38\u670d\u52a1\u5668 (\u771f\u5b9e\u8bbf\u95ee\u670d\u52a1\u5668)\uff0c\u4e00\u65e6\u51fa\u73b0\u6545\u969c\u6216\u8005\u662f\u6ca1\u6709\u53ca\u65f6\u76f8\u5e94\u7684\u8bdd\uff0c\u5e94\u8be5\u76f4\u63a5\u8f6e\u8bad\u5230\u4e0b\u4e00\u53f0\u670d\u52a1\u5668\uff0c\u4fdd\u8bc1\u670d\u52a1\u5668\u7684\u9ad8\u53ef\u7528<\/p>\n<\/blockquote>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">Nginx \u914d\u7f6e\u4ee3\u7801\uff1a<\/p>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\">server\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0listen\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a080;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0server_name\u00a0\u00a0www.lijie.com;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0location\u00a0\/\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">###\u00a0\u6307\u5b9a\u4e0a\u6e38\u670d\u52a1\u5668\u8d1f\u8f7d\u5747\u8861\u670d\u52a1\u5668<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0proxy_pass\u00a0http:\/\/backServer;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">###nginx\u4e0e\u4e0a\u6e38\u670d\u52a1\u5668(\u771f\u5b9e\u8bbf\u95ee\u7684\u670d\u52a1\u5668)\u8d85\u65f6\u65f6\u95f4\u00a0\u540e\u7aef\u670d\u52a1\u5668\u8fde\u63a5\u7684\u8d85\u65f6\u65f6\u95f4_\u53d1\u8d77\u63e1\u624b\u7b49\u5019\u54cd\u5e94\u8d85\u65f6\u65f6\u95f4<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0proxy_connect_timeout\u00a01s;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">###nginx\u53d1\u9001\u7ed9\u4e0a\u6e38\u670d\u52a1\u5668(\u771f\u5b9e\u8bbf\u95ee\u7684\u670d\u52a1\u5668)\u8d85\u65f6\u65f6\u95f4<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0proxy_send_timeout\u00a01s;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">###\u00a0nginx\u63a5\u53d7\u4e0a\u6e38\u670d\u52a1\u5668(\u771f\u5b9e\u8bbf\u95ee\u7684\u670d\u52a1\u5668)\u8d85\u65f6\u65f6\u95f4<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0proxy_read_timeout\u00a01s;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0index\u00a0\u00a0index.html\u00a0index.htm;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0}\n<\/code><\/pre>\n<h2 style=\"margin-top: 30px; font-weight: bold; font-size: 22px; border-bottom: 2px solid #595959; margin-bottom: 30px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"display: inline-block; border-bottom: 2px solid #595959;\"><strong style=\"color: #47c1a8;\">Nginx \u600e\u4e48\u5224\u65ad\u522b IP \u4e0d\u53ef\u8bbf\u95ee\uff1f<\/strong><\/span><\/h2>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\"><span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u5982\u679c\u8bbf\u95ee\u7684ip\u5730\u5740\u4e3a192.168.9.115,\u5219\u8fd4\u56de403<\/span>\n\u00a0<span style=\"color: #c678dd; line-height: 26px;\">if<\/span>\u00a0\u00a0(<span style=\"color: #d19a66; line-height: 26px;\">$remote_addr<\/span>\u00a0=\u00a0192.168.9.115)\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #e6c07b; line-height: 26px;\">return<\/span>\u00a0403;\n\u00a0}\n<\/code><\/pre>\n<h2 style=\"margin-top: 30px; font-weight: bold; font-size: 22px; border-bottom: 2px solid #595959; margin-bottom: 30px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"display: inline-block; border-bottom: 2px solid #595959;\"><strong style=\"color: #47c1a8;\">\u5728 nginx \u4e2d\uff0c\u5982\u4f55\u4f7f\u7528\u672a\u5b9a\u4e49\u7684\u670d\u52a1\u5668\u540d\u79f0\u6765\u963b\u6b62\u5904\u7406\u8bf7\u6c42\uff1f<\/strong><\/span><\/h2>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u53ea\u9700\u5c06\u8bf7\u6c42\u5220\u9664\u7684\u670d\u52a1\u5668\u5c31\u53ef\u4ee5\u5b9a\u4e49\u4e3a\uff1a<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u670d\u52a1\u5668\u540d\u88ab\u4fdd\u7559\u4e00\u4e2a\u7a7a\u5b57\u7b26\u4e32\uff0c\u4ed6\u5728\u6ca1\u6709\u4e3b\u673a\u5934\u5b57\u6bb5\u7684\u60c5\u51b5\u4e0b\u5339\u914d\u8bf7\u6c42\uff0c\u800c\u4e00\u4e2a\u7279\u6b8a\u7684 nginx \u7684\u975e\u6807\u51c6\u4ee3\u7801\u88ab\u8fd4\u56de\uff0c\u4ece\u800c\u7ec8\u6b62\u8fde\u63a5\u3002<\/p>\n<h2 style=\"margin-top: 30px; font-weight: bold; font-size: 22px; border-bottom: 2px solid #595959; margin-bottom: 30px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"display: inline-block; border-bottom: 2px solid #595959;\"><strong style=\"color: #47c1a8;\">\u600e\u4e48\u9650\u5236\u6d4f\u89c8\u5668\u8bbf\u95ee\uff1f<\/strong><\/span><\/h2>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\"><span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">##\u00a0\u4e0d\u5141\u8bb8\u8c37\u6b4c\u6d4f\u89c8\u5668\u8bbf\u95ee\u00a0\u5982\u679c\u662f\u8c37\u6b4c\u6d4f\u89c8\u5668\u8fd4\u56de500<\/span>\n<span style=\"color: #c678dd; line-height: 26px;\">if<\/span>\u00a0(<span style=\"color: #d19a66; line-height: 26px;\">$http_user_agent<\/span>\u00a0~\u00a0Chrome)\u00a0{\n\u00a0\u00a0<span style=\"color: #e6c07b; line-height: 26px;\">return<\/span>\u00a0500;\n}\nRewrite\u5168\u5c40\u53d8\u91cf\u662f\u4ec0\u4e48\uff1f\n<span style=\"color: #d19a66; line-height: 26px;\">$remote_addr<\/span>\u00a0\/\/\u83b7\u53d6\u5ba2\u6237\u7aefip\n<span style=\"color: #d19a66; line-height: 26px;\">$binary_remote_addr<\/span>\u00a0\/\/\u5ba2\u6237\u7aefip\uff08\u4e8c\u8fdb\u5236)\n<span style=\"color: #d19a66; line-height: 26px;\">$remote_port<\/span>\u00a0\/\/\u5ba2\u6237\u7aefport\uff0c\u5982\uff1a50472\n<span style=\"color: #d19a66; line-height: 26px;\">$remote_user<\/span>\u00a0\/\/\u5df2\u7ecf\u7ecf\u8fc7Auth\u00a0Basic\u00a0Module\u9a8c\u8bc1\u7684\u7528\u6237\u540d\n<span style=\"color: #d19a66; line-height: 26px;\">$host<\/span>\u00a0\/\/\u8bf7\u6c42\u4e3b\u673a\u5934\u5b57\u6bb5\uff0c\u5426\u5219\u4e3a\u670d\u52a1\u5668\u540d\u79f0\uff0c\u5982:blog.sakmon.com\n<span style=\"color: #d19a66; line-height: 26px;\">$request<\/span>\u00a0\/\/\u7528\u6237\u8bf7\u6c42\u4fe1\u606f\uff0c\u5982\uff1aGET ?a=1&amp;b=2 HTTP\/1.1\n<span style=\"color: #d19a66; line-height: 26px;\">$request_filename<\/span>\u00a0\/\/\u5f53\u524d\u8bf7\u6c42\u7684\u6587\u4ef6\u7684\u8def\u5f84\u540d\uff0c\u7531root\u6216<span style=\"color: #e6c07b; line-height: 26px;\">alias<\/span>\u548cURI request\u7ec4\u5408\u800c\u6210\uff0c\u5982\uff1a\/2013\/81.html\n<span style=\"color: #d19a66; line-height: 26px;\">$status<\/span>\u00a0\/\/\u8bf7\u6c42\u7684\u54cd\u5e94\u72b6\u6001\u7801,\u5982:200\n<span style=\"color: #d19a66; line-height: 26px;\">$body_bytes_sent<\/span>\u00a0\/\/\u00a0\u54cd\u5e94\u65f6\u9001\u51fa\u7684body\u5b57\u8282\u6570\u6570\u91cf\u3002\u5373\u4f7f\u8fde\u63a5\u4e2d\u65ad\uff0c\u8fd9\u4e2a\u6570\u636e\u4e5f\u662f\u7cbe\u786e\u7684,\u5982\uff1a40\n<span style=\"color: #d19a66; line-height: 26px;\">$content_length<\/span>\u00a0\/\/\u00a0\u7b49\u4e8e\u8bf7\u6c42\u884c\u7684\u201cContent_Length\u201d\u7684\u503c\n<span style=\"color: #d19a66; line-height: 26px;\">$content_type<\/span>\u00a0\/\/\u00a0\u7b49\u4e8e\u8bf7\u6c42\u884c\u7684\u201cContent_Type\u201d\u7684\u503c\n<span style=\"color: #d19a66; line-height: 26px;\">$http_referer<\/span>\u00a0\/\/\u00a0\u5f15\u7528\u5730\u5740\n<span style=\"color: #d19a66; line-height: 26px;\">$http_user_agent<\/span>\u00a0\/\/\u00a0\u5ba2\u6237\u7aefagent\u4fe1\u606f,\u5982\uff1aMozilla\/5.0\u00a0(Windows NT 5.1) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/29.0.1547.76 Safari\/537.36\n<span style=\"color: #d19a66; line-height: 26px;\">$args<\/span>\u00a0\/\/\u4e0e<span style=\"color: #d19a66; line-height: 26px;\">$query_string<\/span>\u76f8\u540c\u00a0\u7b49\u4e8e\u5f53\u4e2dURL\u7684\u53c2\u6570(GET)\uff0c\u5982a=1&amp;b=2\n<span style=\"color: #d19a66; line-height: 26px;\">$document_uri<\/span>\u00a0\/\/\u4e0e<span style=\"color: #d19a66; line-height: 26px;\">$uri<\/span>\u76f8\u540c\u00a0\u8fd9\u4e2a\u53d8\u91cf\u6307\u5f53\u524d\u7684\u8bf7\u6c42URI\uff0c\u4e0d\u5305\u62ec\u4efb\u4f55\u53c2\u6570(\u89c1<span style=\"color: #d19a66; line-height: 26px;\">$args<\/span>)\u00a0\u5982:\/2013\/81.html\n<span style=\"color: #d19a66; line-height: 26px;\">$document_root<\/span>\u00a0\/\/\u9488\u5bf9\u5f53\u524d\u8bf7\u6c42\u7684\u6839\u8def\u5f84\u8bbe\u7f6e\u503c\n<span style=\"color: #d19a66; line-height: 26px;\">$hostname<\/span>\u00a0\/\/\u5982\uff1acentos53.localdomain\n<span style=\"color: #d19a66; line-height: 26px;\">$http_cookie<\/span>\u00a0\/\/\u5ba2\u6237\u7aefcookie\u4fe1\u606f\n<span style=\"color: #d19a66; line-height: 26px;\">$cookie_COOKIE<\/span>\u00a0\/\/cookie\u00a0COOKIE\u53d8\u91cf\u7684\u503c\n<span style=\"color: #d19a66; line-height: 26px;\">$is_args<\/span>\u00a0\/\/\u5982\u679c\u6709<span style=\"color: #d19a66; line-height: 26px;\">$args<\/span>\u53c2\u6570\uff0c\u8fd9\u4e2a\u53d8\u91cf\u7b49\u4e8e\u201d?\u201d\uff0c\u5426\u5219\u7b49\u4e8e\u201d<span style=\"color: #98c379; line-height: 26px;\">\"\uff0c\u7a7a\u503c\uff0c\u5982?\n<span style=\"color: #d19a66; line-height: 26px;\">$limit_rate<\/span>\u00a0\/\/\u8fd9\u4e2a\u53d8\u91cf\u53ef\u4ee5\u9650\u5236\u8fde\u63a5\u901f\u7387\uff0c0\u8868\u793a\u4e0d\u9650\u901f\n<span style=\"color: #d19a66; line-height: 26px;\">$query_string<\/span>\u00a0\/\/\u00a0\u4e0e<span style=\"color: #d19a66; line-height: 26px;\">$args<\/span>\u76f8\u540c\u00a0\u7b49\u4e8e\u5f53\u4e2dURL\u7684\u53c2\u6570(GET)\uff0c\u5982a=1&amp;b=2\n<span style=\"color: #d19a66; line-height: 26px;\">$request_body<\/span>\u00a0\/\/\u00a0\u8bb0\u5f55POST\u8fc7\u6765\u7684\u6570\u636e\u4fe1\u606f\n<span style=\"color: #d19a66; line-height: 26px;\">$request_body_file<\/span>\u00a0\/\/\u5ba2\u6237\u7aef\u8bf7\u6c42\u4e3b\u4f53\u4fe1\u606f\u7684\u4e34\u65f6\u6587\u4ef6\u540d\n<span style=\"color: #d19a66; line-height: 26px;\">$request_method<\/span>\u00a0\/\/\u5ba2\u6237\u7aef\u8bf7\u6c42\u7684\u52a8\u4f5c\uff0c\u901a\u5e38\u4e3aGET\u6216POST,\u5982\uff1aGET\n<span style=\"color: #d19a66; line-height: 26px;\">$request_uri<\/span>\u00a0\/\/\u5305\u542b\u8bf7\u6c42\u53c2\u6570\u7684\u539f\u59cbURI\uff0c\u4e0d\u5305\u542b\u4e3b\u673a\u540d\uff0c\u5982\uff1a\/2013\/81.html?a=1&amp;b=2\n<span style=\"color: #d19a66; line-height: 26px;\">$scheme<\/span>\u00a0\/\/HTTP\u65b9\u6cd5\uff08\u5982http\uff0chttps\uff09,\u5982\uff1ahttp\n<span style=\"color: #d19a66; line-height: 26px;\">$uri<\/span>\u00a0\/\/\u8fd9\u4e2a\u53d8\u91cf\u6307\u5f53\u524d\u7684\u8bf7\u6c42URI\uff0c\u4e0d\u5305\u62ec\u4efb\u4f55\u53c2\u6570(\u89c1<span style=\"color: #d19a66; line-height: 26px;\">$args<\/span>)\u00a0\u5982:\/2013\/81.html\n<span style=\"color: #d19a66; line-height: 26px;\">$request_completion<\/span>\u00a0\/\/\u5982\u679c\u8bf7\u6c42\u7ed3\u675f\uff0c\u8bbe\u7f6e\u4e3aOK. \u5f53\u8bf7\u6c42\u672a\u7ed3\u675f\u6216\u5982\u679c\u8be5\u8bf7\u6c42\u4e0d\u662f\u8bf7\u6c42\u94fe\u4e32\u7684\u6700\u540e\u4e00\u4e2a\u65f6\uff0c\u4e3a\u7a7a(Empty)\uff0c\u5982\uff1aOK\n<span style=\"color: #d19a66; line-height: 26px;\">$server_protocol<\/span>\u00a0\/\/\u8bf7\u6c42\u4f7f\u7528\u7684\u534f\u8bae\uff0c\u901a\u5e38\u662fHTTP\/1.0\u6216HTTP\/1.1\uff0c\u5982\uff1aHTTP\/1.1\n<span style=\"color: #d19a66; line-height: 26px;\">$server_addr<\/span>\u00a0\/\/\u670d\u52a1\u5668IP\u5730\u5740\uff0c\u5728\u5b8c\u6210\u4e00\u6b21\u7cfb\u7edf\u8c03\u7528\u540e\u53ef\u4ee5\u786e\u5b9a\u8fd9\u4e2a\u503c\n<span style=\"color: #d19a66; line-height: 26px;\">$server_name<\/span>\u00a0\/\/\u670d\u52a1\u5668\u540d\u79f0\uff0c\u5982\uff1ablog.sakmon.com\n<span style=\"color: #d19a66; line-height: 26px;\">$server_port<\/span>\u00a0\/\/\u8bf7\u6c42\u5230\u8fbe\u670d\u52a1\u5668\u7684\u7aef\u53e3\u53f7,\u5982\uff1a80\n<\/span><\/code><\/pre>\n<h2 style=\"margin-top: 30px; font-weight: bold; font-size: 22px; border-bottom: 2px solid #595959; margin-bottom: 30px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"display: inline-block; border-bottom: 2px solid #595959;\"><strong style=\"color: #47c1a8;\">Nginx \u5982\u4f55\u5b9e\u73b0\u540e\u7aef\u670d\u52a1\u7684\u5065\u5eb7\u68c0\u67e5?<\/strong><\/span><\/h2>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u65b9\u5f0f\u4e00\uff0c\u5229\u7528 nginx \u81ea\u5e26\u6a21\u5757 ngx_http_proxy_module \u548c ngx_http_upstream_module \u5bf9\u540e\u7aef\u8282\u70b9\u505a\u5065\u5eb7\u68c0\u67e5\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u65b9\u5f0f\u4e8c (\u63a8\u8350)\uff0c\u5229\u7528 nginx_upstream_check_module \u6a21\u5757\u5bf9\u540e\u7aef\u8282\u70b9\u505a\u5065\u5eb7\u68c0\u67e5\u3002<\/p>\n<h2 style=\"margin-top: 30px; font-weight: bold; font-size: 22px; border-bottom: 2px solid #595959; margin-bottom: 30px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"display: inline-block; border-bottom: 2px solid #595959;\"><strong style=\"color: #47c1a8;\">Nginx \u5982\u4f55\u5f00\u542f\u538b\u7f29\uff1f<\/strong><\/span><\/h2>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5f00\u542f nginx gzip \u538b\u7f29\u540e\uff0c\u7f51\u9875\u3001css\u3001js \u7b49\u9759\u6001\u8d44\u6e90\u7684\u5927\u5c0f\u4f1a\u5927\u5927\u7684\u51cf\u5c11\uff0c\u4ece\u800c\u53ef\u4ee5\u8282\u7ea6\u5927\u91cf\u7684\u5e26\u5bbd\uff0c\u63d0\u9ad8\u4f20\u8f93\u6548\u7387\uff0c\u7ed9\u7528\u6237\u5feb\u7684\u4f53\u9a8c\u3002\u867d\u7136\u4f1a\u6d88\u8017 cpu \u8d44\u6e90\uff0c\u4f46\u662f\u4e3a\u4e86\u7ed9\u7528\u6237\u66f4\u597d\u7684\u4f53\u9a8c\u662f\u503c\u5f97\u7684\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5f00\u542f\u7684\u914d\u7f6e\u5982\u4e0b\uff1a<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5c06\u4ee5\u4e0a\u914d\u7f6e\u653e\u5230 nginx.conf \u7684 http{\u2026} \u8282\u70b9\u4e2d\u3002<\/p>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\">http\u00a0{\n\u00a0\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u5f00\u542fgzip<\/span>\n\u00a0\u00a0gzip\u00a0on;\n\u00a0\n\u00a0\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u542f\u7528gzip\u538b\u7f29\u7684\u6700\u5c0f\u6587\u4ef6\uff1b\u5c0f\u4e8e\u8bbe\u7f6e\u503c\u7684\u6587\u4ef6\u5c06\u4e0d\u4f1a\u88ab\u538b\u7f29<\/span>\n\u00a0\u00a0gzip_min_length\u00a01k;\n\u00a0\n\u00a0\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0gzip\u00a0\u538b\u7f29\u7ea7\u522b\u00a01-10<\/span>\n\u00a0\u00a0gzip_comp_level\u00a02;\n\u00a0\n\u00a0\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u8fdb\u884c\u538b\u7f29\u7684\u6587\u4ef6\u7c7b\u578b\u3002<\/span>\n\u00a0\n\u00a0\u00a0gzip_types\u00a0text\/plain\u00a0application\/javascript\u00a0application\/x-javascript\u00a0text\/css\u00a0application\/xml\u00a0text\/javascript\u00a0application\/x-httpd-php\u00a0image\/jpeg\u00a0image\/gif\u00a0image\/png;\n\u00a0\n\u00a0\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u662f\u5426\u5728http\u00a0header\u4e2d\u6dfb\u52a0Vary:\u00a0Accept-Encoding\uff0c\u5efa\u8bae\u5f00\u542f<\/span>\n\u00a0\u00a0gzip_vary\u00a0on;\n}\n<\/code><\/pre>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u4fdd\u5b58\u5e76\u91cd\u542f nginx\uff0c\u5237\u65b0\u9875\u9762\uff08\u4e3a\u4e86\u907f\u514d\u7f13\u5b58\uff0c\u8bf7\u5f3a\u5236\u5237\u65b0\uff09\u5c31\u80fd\u770b\u5230\u6548\u679c\u4e86\u3002\u4ee5\u8c37\u6b4c\u6d4f\u89c8\u5668\u4e3a\u4f8b\uff0c\u901a\u8fc7 F12 \u770b\u8bf7\u6c42\u7684\u54cd\u5e94\u5934\u90e8\uff1a<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u6211\u4eec\u53ef\u4ee5\u5148\u6765\u5bf9\u6bd4\u4e0b\uff0c\u5982\u679c\u6211\u4eec\u6ca1\u6709\u5f00\u542f zip \u538b\u7f29\u4e4b\u524d\uff0c\u6211\u4eec\u7684\u5bf9\u5e94\u7684\u6587\u4ef6\u5927\u5c0f\uff0c\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<figure style=\"margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-src=\"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201115543.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-ratio=\"0.09537037037037037\" data-w=\"1080\" data-data-src=\"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201115543.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" src=\"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201115543.png\" data-ratio=\"0.09537037037037037\" data-w=\"1080\" data-src=\"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201115543.png\" \/><\/noscript><\/figure>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u73b0\u5728\u6211\u4eec\u5f00\u542f\u4e86 gzip \u8fdb\u884c\u538b\u7f29\u540e\u7684\u6587\u4ef6\u7684\u5927\u5c0f\uff0c\u53ef\u4ee5\u770b\u5230\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<figure style=\"margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-src=\"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201117654.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-ratio=\"0.13518518518518519\" data-w=\"1080\" data-data-src=\"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201117654.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" src=\"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201117654.png\" data-ratio=\"0.13518518518518519\" data-w=\"1080\" data-src=\"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201117654.png\" \/><\/noscript><\/figure>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5e76\u4e14\u6211\u4eec\u67e5\u770b\u54cd\u5e94\u5934\u4f1a\u770b\u5230 gzip \u8fd9\u6837\u7684\u538b\u7f29\uff0c\u5982\u4e0b\u6240\u793a<\/p>\n<figure style=\"margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-src=\"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201118184.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-ratio=\"0.6148148148148148\" data-data-src=\"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201118184.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-w=\"1080\" \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" src=\"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201118184.png\" data-ratio=\"0.6148148148148148\" data-src=\"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201118184.png\" data-w=\"1080\" \/><\/noscript><\/figure>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">gzip \u538b\u7f29\u524d\u540e\u6548\u679c\u5bf9\u6bd4\uff1ajquery \u539f\u5927\u5c0f 90kb\uff0c\u538b\u7f29\u540e\u53ea\u6709 30kb\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">gzip \u867d\u7136\u597d\u7528\uff0c\u4f46\u662f\u4ee5\u4e0b\u7c7b\u578b\u7684\u8d44\u6e90\u4e0d\u5efa\u8bae\u542f\u7528\u3002<\/p>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 18px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">1\u3001\u56fe\u7247\u7c7b\u578b<\/h4>\n<blockquote style=\"font-size: 0.9em; overflow: auto; background: rgba(0, 0, 0, 0.05); margin-bottom: 20px; margin-top: 20px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; line-height: 1.8; color: #888888; border: initial none initial;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><p><span style=\"color: #555555; font-size: 4em; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201c<\/span><\/p>\n<p style=\"font-size: 16px; padding-top: 8px; padding-bottom: 8px; color: black; line-height: 26px; display: inline;\">\u539f\u56e0\uff1a\u56fe\u7247\u5982 jpg\u3001png \u672c\u8eab\u5c31\u4f1a\u6709\u538b\u7f29\uff0c\u6240\u4ee5\u5c31\u7b97\u5f00\u542f gzip \u540e\uff0c\u538b\u7f29\u524d\u548c\u538b\u7f29\u540e\u5927\u5c0f\u6ca1\u6709\u591a\u5927\u533a\u522b\uff0c\u6240\u4ee5\u5f00\u542f\u4e86\u53cd\u800c\u4f1a\u767d\u767d\u7684\u6d6a\u8d39\u8d44\u6e90\u3002\uff08Tips\uff1a\u53ef\u4ee5\u8bd5\u8bd5\u5c06\u4e00\u5f20 jpg \u56fe\u7247\u538b\u7f29\u4e3a zip\uff0c\u89c2\u5bdf\u5927\u5c0f\u5e76\u6ca1\u6709\u591a\u5927\u7684\u53d8\u5316\u3002\u867d\u7136 zip \u548c gzip \u7b97\u6cd5\u4e0d\u4e00\u6837\uff0c\u4f46\u662f\u53ef\u4ee5\u770b\u51fa\u538b\u7f29\u56fe\u7247\u7684\u4ef7\u503c\u5e76\u4e0d\u5927\uff09<\/p>\n<\/blockquote>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 18px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">2\u3001\u5927\u6587\u4ef6<\/h4>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u539f\u56e0\uff1a\u4f1a\u6d88\u8017\u5927\u91cf\u7684 cpu \u8d44\u6e90\uff0c\u4e14\u4e0d\u4e00\u5b9a\u6709\u660e\u663e\u7684\u6548\u679c\u3002<\/p>\n<h2 style=\"margin-top: 30px; font-weight: bold; font-size: 22px; border-bottom: 2px solid #595959; margin-bottom: 30px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"display: inline-block; border-bottom: 2px solid #595959;\"><strong style=\"color: #47c1a8;\">ngx_http_upstream_module \u7684\u4f5c\u7528\u662f\u4ec0\u4e48?<\/strong><\/span><\/h2>\n<blockquote style=\"font-size: 0.9em; overflow: auto; background: rgba(0, 0, 0, 0.05); margin-bottom: 20px; margin-top: 20px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; line-height: 1.8; color: #888888; border: initial none initial;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><p><span style=\"color: #555555; font-size: 4em; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201c<\/span><\/p>\n<p style=\"font-size: 16px; padding-top: 8px; padding-bottom: 8px; color: black; line-height: 26px; display: inline;\">ngx_http_upstream_module \u7528\u4e8e\u5b9a\u4e49\u53ef\u901a\u8fc7 fastcgi \u4f20\u9012\u3001proxy \u4f20\u9012\u3001uwsgi \u4f20\u9012\u3001memcached \u4f20\u9012\u548c scgi \u4f20\u9012\u6307\u4ee4\u6765\u5f15\u7528\u7684\u670d\u52a1\u5668\u7ec4\u3002<\/p>\n<\/blockquote>\n<h2 style=\"margin-top: 30px; font-weight: bold; font-size: 22px; border-bottom: 2px solid #595959; margin-bottom: 30px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"display: inline-block; border-bottom: 2px solid #595959;\"><strong style=\"color: #47c1a8;\">\u4ec0\u4e48\u662f C10K \u95ee\u9898?<\/strong><\/span><\/h2>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">C10K \u95ee\u9898\u662f\u6307\u65e0\u6cd5\u540c\u65f6\u5904\u7406\u5927\u91cf\u5ba2\u6237\u7aef (10,000) \u7684\u7f51\u7edc\u5957\u63a5\u5b57\u3002<\/p>\n<h2 style=\"margin-top: 30px; font-weight: bold; font-size: 22px; border-bottom: 2px solid #595959; margin-bottom: 30px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"display: inline-block; border-bottom: 2px solid #595959;\"><strong style=\"color: #47c1a8;\">Nginx \u662f\u5426\u652f\u6301\u5c06\u8bf7\u6c42\u538b\u7f29\u5230\u4e0a\u6e38?<\/strong><\/span><\/h2>\n<blockquote style=\"font-size: 0.9em; overflow: auto; background: rgba(0, 0, 0, 0.05); margin-bottom: 20px; margin-top: 20px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; line-height: 1.8; color: #888888; border: initial none initial;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><p><span style=\"color: #555555; font-size: 4em; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201c<\/span><\/p>\n<p style=\"font-size: 16px; padding-top: 8px; padding-bottom: 8px; color: black; line-height: 26px; display: inline;\">\u60a8\u53ef\u4ee5\u4f7f\u7528 Nginx \u6a21\u5757 gunzip \u5c06\u8bf7\u6c42\u538b\u7f29\u5230\u4e0a\u6e38\u3002gunzip \u6a21\u5757\u662f\u4e00\u4e2a\u8fc7\u6ee4\u5668\uff0c\u5b83\u53ef\u4ee5\u5bf9\u4e0d\u652f\u6301 \u201cgzip\u201d \u7f16\u7801\u65b9\u6cd5\u7684\u5ba2\u6237\u673a\u6216\u670d\u52a1\u5668\u4f7f\u7528 \u201c\u5185\u5bb9\u7f16\u7801: gzip\u201d \u6765\u89e3\u538b\u7f29\u54cd\u5e94\u3002<\/p>\n<\/blockquote>\n<h2 style=\"margin-top: 30px; font-weight: bold; font-size: 22px; border-bottom: 2px solid #595959; margin-bottom: 30px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"display: inline-block; border-bottom: 2px solid #595959;\"><strong style=\"color: #47c1a8;\">\u5982\u4f55\u5728 Nginx \u4e2d\u83b7\u5f97\u5f53\u524d\u7684\u65f6\u95f4?<\/strong><\/span><\/h2>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u8981\u83b7\u5f97 Nginx \u7684\u5f53\u524d\u65f6\u95f4\uff0c\u5fc5\u987b\u4f7f\u7528 SSI \u6a21\u5757\u3001\u548c date_local \u7684\u53d8\u91cf\u3002<\/p>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\">Proxy_set_header\u00a0THE-TIME\u00a0<span style=\"color: #d19a66; line-height: 26px;\">$date_gmt<\/span>;\n<\/code><\/pre>\n<h2 style=\"margin-top: 30px; font-weight: bold; font-size: 22px; border-bottom: 2px solid #595959; margin-bottom: 30px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"display: inline-block; border-bottom: 2px solid #595959;\"><strong style=\"color: #47c1a8;\">\u7528 Nginx \u670d\u52a1\u5668\u89e3\u91ca - s \u7684\u76ee\u7684\u662f\u4ec0\u4e48?<\/strong><\/span><\/h2>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u7528\u4e8e\u8fd0\u884c Nginx -s \u53c2\u6570\u7684\u53ef\u6267\u884c\u6587\u4ef6\u3002<\/p>\n<h2 style=\"margin-top: 30px; font-weight: bold; font-size: 22px; border-bottom: 2px solid #595959; margin-bottom: 30px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"display: inline-block; border-bottom: 2px solid #595959;\"><strong style=\"color: #47c1a8;\">\u5982\u4f55\u5728 Nginx \u670d\u52a1\u5668\u4e0a\u6dfb\u52a0\u6a21\u5757?<\/strong><\/span><\/h2>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5728\u7f16\u8bd1\u8fc7\u7a0b\u4e2d\uff0c\u5fc5\u987b\u9009\u62e9 Nginx \u6a21\u5757\uff0c\u56e0\u4e3a Nginx \u4e0d\u652f\u6301\u6a21\u5757\u7684\u8fd0\u884c\u65f6\u95f4\u9009\u62e9\u3002<\/p>\n<h2 style=\"margin-top: 30px; font-weight: bold; font-size: 22px; border-bottom: 2px solid #595959; margin-bottom: 30px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"display: inline-block; border-bottom: 2px solid #595959;\"><strong style=\"color: #47c1a8;\">\u751f\u4ea7\u4e2d\u5982\u4f55\u8bbe\u7f6e worker \u8fdb\u7a0b\u7684\u6570\u91cf\u5462\uff1f<\/strong><\/span><\/h2>\n<blockquote style=\"font-size: 0.9em; overflow: auto; background: rgba(0, 0, 0, 0.05); margin-bottom: 20px; margin-top: 20px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; line-height: 1.8; color: #888888; border: initial none initial;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><p><span style=\"color: #555555; font-size: 4em; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201c<\/span><\/p>\n<p style=\"font-size: 16px; padding-top: 8px; padding-bottom: 8px; color: black; line-height: 26px; display: inline;\">\u5728\u6709\u591a\u4e2a cpu \u7684\u60c5\u51b5\u4e0b\uff0c\u53ef\u4ee5\u8bbe\u7f6e\u591a\u4e2a worker\uff0cworker \u8fdb\u7a0b\u7684\u6570\u91cf\u53ef\u4ee5\u8bbe\u7f6e\u5230\u548c cpu \u7684\u6838\u5fc3\u6570\u4e00\u6837\u591a\uff0c\u5982\u679c\u5728\u5355\u4e2a cpu \u4e0a\u8d77\u591a\u4e2a worker \u8fdb\u7a0b\uff0c\u90a3\u4e48\u64cd\u4f5c\u7cfb\u7edf\u4f1a\u5728\u591a\u4e2a worker \u4e4b\u95f4\u8fdb\u884c\u8c03\u5ea6\uff0c\u8fd9\u79cd\u60c5\u51b5\u4f1a\u964d\u4f4e\u7cfb\u7edf\u6027\u80fd\uff0c\u5982\u679c\u53ea\u6709\u4e00\u4e2a cpu\uff0c\u90a3\u4e48\u53ea\u542f\u52a8\u4e00\u4e2a worker \u8fdb\u7a0b\u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n<\/blockquote>\n<h2 style=\"margin-top: 30px; font-weight: bold; font-size: 22px; border-bottom: 2px solid #595959; margin-bottom: 30px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"display: inline-block; border-bottom: 2px solid #595959;\"><strong style=\"color: #47c1a8;\">nginx \u72b6\u6001\u7801<\/strong><\/span><\/h2>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">499\uff1a<\/p>\n<blockquote style=\"font-size: 0.9em; overflow: auto; background: rgba(0, 0, 0, 0.05); margin-bottom: 20px; margin-top: 20px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; line-height: 1.8; color: #888888; border: initial none initial;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><p><span style=\"color: #555555; font-size: 4em; font-family: Arial, serif; line-height: 1em; font-weight: bold;\">\u201c<\/span><\/p>\n<p style=\"font-size: 16px; padding-top: 8px; padding-bottom: 8px; color: black; line-height: 26px; display: inline;\">\u670d\u52a1\u7aef\u5904\u7406\u65f6\u95f4\u8fc7\u957f\uff0c\u5ba2\u6237\u7aef\u4e3b\u52a8\u5173\u95ed\u4e86\u8fde\u63a5\u3002<\/p>\n<\/blockquote>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">502\uff1a<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">(1).FastCGI \u8fdb\u7a0b\u662f\u5426\u5df2\u7ecf\u542f\u52a8<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">(2).FastCGI worker \u8fdb\u7a0b\u6570\u662f\u5426\u4e0d\u591f<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">(3).FastCGI \u6267\u884c\u65f6\u95f4\u8fc7\u957f<\/p>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">fastcgi_connect_timeout 300;<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">fastcgi_send_timeout 300;<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">fastcgi_read_timeout 300;<\/section>\n<\/li>\n<\/ul>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">(4).FastCGI Buffer \u4e0d\u591f\uff0cnginx \u548c apache \u4e00\u6837\uff0c\u6709\u524d\u7aef\u7f13\u51b2\u9650\u5236\uff0c\u53ef\u4ee5\u8c03\u6574\u7f13\u51b2\u53c2\u6570<\/p>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">fastcgi_buffer_size 32k;<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">fastcgi_buffers 8 32k;<\/section>\n<\/li>\n<\/ul>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">(5). Proxy Buffer \u4e0d\u591f\uff0c\u5982\u679c\u4f60\u7528\u4e86 Proxying\uff0c\u8c03\u6574<\/p>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">proxy_buffer_size 16k;<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">proxy_buffers 4 16k;<\/section>\n<\/li>\n<\/ul>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #595959;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">(6).php \u811a\u672c\u6267\u884c\u65f6\u95f4\u8fc7\u957f<\/p>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u5c06 php-fpm.conf \u7684 0s \u7684 0s \u6539\u6210\u4e00\u4e2a\u65f6\u95f4<\/section>\n<\/li>\n<\/ul>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\"><span style=\"letter-spacing: 0.578px; text-align: right; font-size: 12px; color: #d6d6d6;\">\u539f\u6587\u6765\u6e90\uff1a<\/span><\/section>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\"><span style=\"letter-spacing: 0.578px; text-align: right; font-size: 12px; color: #d6d6d6;\">blog.csdn.net\/wuzhiwei549\/article\/details\/122758937<\/span><\/section>\n<section style=\"margin-top: 15px; margin-bottom: 15px; padding-right: 0.5em; padding-left: 0.5em; outline: 0px; color: #000000; white-space: normal; text-align: center; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; letter-spacing: 0.544px; line-height: 1.75em; visibility: visible;\"><span style=\"outline: 0px; color: #021eaa; font-family: monospace; letter-spacing: 0.544px; white-space: pre-wrap; visibility: visible;\">- END -<\/span><\/section>\n<\/section>\n<section><\/section>\n<p style=\"display: none;\">\n","raw":"","protected":false},"excerpt":{"rendered":"<p>\u201c Nginx \u662f\u4e00\u6b3e\u8f7b\u91cf\u7ea7\u7684 Web \u670d\u52a1\u5668\u3001\u53cd\u5411\u4ee3\u7406\u670d\u52a1\u5668\uff0c\u7531\u4e8e\u5b83\u7684\u5185\u5b58\u5360\u7528\u5c11\uff0c\u542f\u52a8\u6781\u5feb\uff0c\u9ad8\u5e76\u53d1\u80fd\u529b\u5f3a\uff0c\u5728\u4e92\u8054\u7f51\u9879\u76ee\u4e2d\u5e7f\u6cdb\u5e94\u7528 &#8230;<\/p>\n","protected":false},"author":1,"featured_media":295,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[5],"tags":[],"class_list":["post-294","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-nginx"],"post_thumbnail_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201045636-150x150.jpg","content_first_image":"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201047176.jpg","post_medium_image_300":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201045636-300x128.jpg","post_thumbnail_image_624":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201045636-1024x435.jpg","post_frist_image":"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201047176.jpg","post_medium_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201045636-300x128.jpg","post_large_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201045636-1024x435.jpg","post_full_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201045636.jpg","post_all_images":[{"imagesurl":"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201047176.jpg","id":"image0"},{"imagesurl":"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201047176.jpg","id":"image1"},{"imagesurl":"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201048844.png","id":"image2"},{"imagesurl":"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201048844.png","id":"image3"},{"imagesurl":"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201103238.png","id":"image4"},{"imagesurl":"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201103238.png","id":"image5"},{"imagesurl":"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201107406.png","id":"image6"},{"imagesurl":"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201107406.png","id":"image7"},{"imagesurl":"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201109165.png","id":"image8"},{"imagesurl":"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201109165.png","id":"image9"},{"imagesurl":"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201113550.png","id":"image10"},{"imagesurl":"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201113550.png","id":"image11"},{"imagesurl":"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201115543.png","id":"image12"},{"imagesurl":"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201115543.png","id":"image13"},{"imagesurl":"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201117654.png","id":"image14"},{"imagesurl":"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201117654.png","id":"image15"},{"imagesurl":"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201118184.png","id":"image16"},{"imagesurl":"\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230527201118184.png","id":"image17"}],"videoAdId":"","listAd":"0","listAdId":"","listAdEvery":6,"total_comments":0,"category_name":"Nginx","post_date":"2023-05-27","like_count":"0","praiseWord":"\u9f13\u52b1","copyright_state":"","excitationAd":"0","rewardedVideoAdId":"","detailAdId":"","detailAd":"0","enterpriseMinapp":"0","audios":[],"postImageUrl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230519082947553.jpg","avatarurls":[],"related_posts":null,"pageviews":335,"next_post_id":391,"next_post_title":"Nginx\u5e38\u7528\u914d\u7f6e\u793a\u4f8b","previous_post_id":204,"previous_post_title":"Nginx\u5165\u95e8\u5230\u7cbe\u901a","_links":{"self":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/294","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/comments?post=294"}],"version-history":[{"count":1,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/294\/revisions"}],"predecessor-version":[{"id":3756,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/294\/revisions\/3756"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media\/295"}],"wp:attachment":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media?parent=294"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/categories?post=294"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/tags?post=294"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}