{"id":204,"date":"2023-05-25T13:44:16","date_gmt":"2023-05-25T05:44:16","guid":{"rendered":"https:\/\/xinchewhd.com.cn\/?p=204"},"modified":"2023-05-25T13:45:09","modified_gmt":"2023-05-25T05:45:09","slug":"b2951d331f","status":"publish","type":"post","link":"https:\/\/xinchewhd.com.cn\/index.php\/nginx\/b2951d331f\/","title":{"rendered":"Nginx\u5165\u95e8\u5230\u7cbe\u901a"},"content":{"rendered":"<div class=\"bpp-post-content\">\n<h2 style=\"box-sizing: border-box; margin-top: 30px; margin-bottom: 15px; color: #000000; font-weight: bold; font-size: 22px; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; text-align: left; white-space: normal; background-color: #ffffff;\"><span style=\"box-sizing: border-box;\">\u4ecb\u7ecd<\/span><\/h2>\n<p style=\"box-sizing: border-box; margin-bottom: 0px; font-size: 16px; padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #000000; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; text-align: left; white-space: normal; background-color: #ffffff;\">Nginx\u662f\u4e00\u4e2a\u9ad8\u6027\u80fd\u7684Web\u670d\u52a1\u5668\uff0c\u5b83\u53ef\u4ee5\u5904\u7406\u5927\u91cf\u7684\u5e76\u53d1\u8bf7\u6c42\uff0c\u540c\u65f6\u8fd8\u53ef\u4ee5\u4f5c\u4e3a\u8d1f\u8f7d\u5747\u8861\u5668\u548c\u53cd\u5411\u4ee3\u7406\u670d\u52a1\u5668\u3002\u5728\u672c\u7bc7\u535a\u6587\u4e2d\uff0c\u6211\u4eec\u5c06\u4ecb\u7ecd\u5982\u4f55\u4ece\u5165\u95e8\u5230\u7cbe\u901aNginx\u7684\u4f7f\u7528\u3002<\/p>\n<h2 style=\"box-sizing: border-box; margin-top: 30px; margin-bottom: 15px; color: #000000; font-weight: bold; font-size: 22px; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; text-align: left; white-space: normal; background-color: #ffffff;\"><span style=\"box-sizing: border-box;\">Nginx\u7684\u5b89\u88c5\u548c\u914d\u7f6e<\/span><\/h2>\n<p style=\"box-sizing: border-box; margin-bottom: 0px; font-size: 16px; padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #000000; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; text-align: left; white-space: normal; background-color: #ffffff;\">\u5728\u5f00\u59cb\u4f7f\u7528Nginx\u4e4b\u524d\uff0c\u60a8\u9700\u8981\u5148\u5b89\u88c5\u548c\u914d\u7f6e\u5b83\u3002\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u5305\u7ba1\u7406\u5668\u6765\u5b89\u88c5Nginx\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u57fa\u672c\u7684\u914d\u7f6e\uff1a<\/p>\n<h3 style=\"box-sizing: border-box; margin-top: 30px; margin-bottom: 15px; color: #000000; font-weight: bold; font-size: 20px; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; text-align: left; white-space: normal; background-color: #ffffff;\"><span style=\"box-sizing: border-box;\">\u76d1\u542c\u7aef\u53e3<\/span><\/h3>\n<p style=\"box-sizing: border-box; margin-bottom: 0px; font-size: 16px; padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #000000; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; text-align: left; white-space: normal; background-color: #ffffff;\">\u76d1\u542c\u7aef\u53e3\u662fNginx\u670d\u52a1\u5668\u63a5\u6536\u8bf7\u6c42\u7684\u5165\u53e3\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cNginx\u76d1\u542c80\u7aef\u53e3\u3002\u60a8\u53ef\u4ee5\u901a\u8fc7\u7f16\u8f91\u914d\u7f6e\u6587\u4ef6\u6765\u66f4\u6539\u76d1\u542c\u7aef\u53e3\u3002<\/p>\n<pre style=\"box-sizing: border-box; font-size: 16px; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin-top: 10px; margin-bottom: 10px; overflow: auto; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px; color: #000000; text-align: left; background-color: #ffffff;\"><code style=\"box-sizing: border-box; font-size: 12px; font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; display: -webkit-box; overflow-x: auto; padding: 15px 16px 16px; color: #abb2bf; background: #282c34; border-radius: 5px;\">listen\u00a08080;<br style=\"box-sizing: border-box;\" \/><br style=\"box-sizing: border-box;\" \/><\/code><\/pre>\n<h3 style=\"box-sizing: border-box; margin-top: 30px; margin-bottom: 15px; color: #000000; font-weight: bold; font-size: 20px; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; text-align: left; white-space: normal; background-color: #ffffff;\"><span style=\"box-sizing: border-box;\">Web\u6839\u76ee\u5f55<\/span><\/h3>\n<p style=\"box-sizing: border-box; margin-bottom: 0px; font-size: 16px; padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #000000; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; text-align: left; white-space: normal; background-color: #ffffff;\">Web\u6839\u76ee\u5f55\u662f\u60a8\u7684Web\u5e94\u7528\u7a0b\u5e8f\u7684\u6839\u76ee\u5f55\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cNginx\u5c06Web\u6839\u76ee\u5f55\u8bbe\u7f6e\u4e3a<code style=\"box-sizing: border-box; font-size: 14px; font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; overflow-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #1e6bb8; background-color: rgba(27, 31, 35, 0.05); word-break: break-all;\">\/usr\/share\/nginx\/html<\/code>\u3002\u60a8\u53ef\u4ee5\u901a\u8fc7\u7f16\u8f91\u914d\u7f6e\u6587\u4ef6\u6765\u66f4\u6539Web\u6839\u76ee\u5f55\u3002<\/p>\n<pre style=\"box-sizing: border-box; font-size: 16px; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin-top: 10px; margin-bottom: 10px; overflow: auto; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px; color: #000000; text-align: left; background-color: #ffffff;\"><code style=\"box-sizing: border-box; font-size: 12px; font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; display: -webkit-box; overflow-x: auto; padding: 15px 16px 16px; color: #abb2bf; background: #282c34; border-radius: 5px;\">root\u00a0\/var\/www\/myapp;<br style=\"box-sizing: border-box;\" \/><br style=\"box-sizing: border-box;\" \/><\/code><\/pre>\n<h3 style=\"box-sizing: border-box; margin-top: 30px; margin-bottom: 15px; color: #000000; font-weight: bold; font-size: 20px; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; text-align: left; white-space: normal; background-color: #ffffff;\"><span style=\"box-sizing: border-box;\">\u865a\u62df\u4e3b\u673a<\/span><\/h3>\n<p style=\"box-sizing: border-box; margin-bottom: 0px; font-size: 16px; padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #000000; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; text-align: left; white-space: normal; background-color: #ffffff;\">\u865a\u62df\u4e3b\u673a\u662f\u6307\u5728\u540c\u4e00\u53f0\u670d\u52a1\u5668\u4e0a\u6258\u7ba1\u591a\u4e2a\u7f51\u7ad9\u6216\u57df\u540d\u3002\u60a8\u53ef\u4ee5\u901a\u8fc7\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u521b\u5efa\u591a\u4e2aserver\u5757\u6765\u5b9e\u73b0\u865a\u62df\u4e3b\u673a\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u793a\u4f8b\uff1a<\/p>\n<pre style=\"box-sizing: border-box; font-size: 16px; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin-top: 10px; margin-bottom: 10px; overflow: auto; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px; color: #000000; text-align: left; background-color: #ffffff;\"><code style=\"box-sizing: border-box; font-size: 12px; font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; display: -webkit-box; overflow-x: auto; padding: 15px 16px 16px; color: #abb2bf; background: #282c34; border-radius: 5px;\">server\u00a0{<br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0listen\u00a080;<br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0server_name\u00a0example.com;<br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0root\u00a0\/var\/www\/example;<br style=\"box-sizing: border-box;\" \/>}<br style=\"box-sizing: border-box;\" \/><br style=\"box-sizing: border-box;\" \/>server\u00a0{<br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0listen\u00a080;<br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0server_name\u00a0example.org;<br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0root\u00a0\/var\/www\/org;<br style=\"box-sizing: border-box;\" \/>}<br style=\"box-sizing: border-box;\" \/><br style=\"box-sizing: border-box;\" \/><\/code><\/pre>\n<h3 style=\"box-sizing: border-box; margin-top: 30px; margin-bottom: 15px; color: #000000; font-weight: bold; font-size: 20px; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; text-align: left; white-space: normal; background-color: #ffffff;\"><span style=\"box-sizing: border-box;\">HTTPS\u652f\u6301<\/span><\/h3>\n<p style=\"box-sizing: border-box; margin-bottom: 0px; font-size: 16px; padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #000000; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; text-align: left; white-space: normal; background-color: #ffffff;\">HTTPS\u662f\u4e00\u79cd\u901a\u8fc7\u52a0\u5bc6\u901a\u4fe1\u4fdd\u62a4\u6570\u636e\u5b89\u5168\u7684\u534f\u8bae\u3002\u8981\u542f\u7528HTTPS\u652f\u6301\uff0c\u60a8\u9700\u8981\u83b7\u53d6\u8bc1\u4e66\uff0c\u5e76\u5c06\u5176\u914d\u7f6e\u5230Nginx\u670d\u52a1\u5668\u4e2d\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u57fa\u672c\u7684\u914d\u7f6e\uff1a<\/p>\n<pre style=\"box-sizing: border-box; font-size: 16px; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin-top: 10px; margin-bottom: 10px; overflow: auto; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px; color: #000000; text-align: left; background-color: #ffffff;\"><code style=\"box-sizing: border-box; font-size: 12px; font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; display: -webkit-box; overflow-x: auto; padding: 15px 16px 16px; color: #abb2bf; background: #282c34; border-radius: 5px;\">server\u00a0{<br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0listen\u00a0443\u00a0ssl;<br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0server_name\u00a0example.com;<br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0root\u00a0\/var\/www\/example;<br style=\"box-sizing: border-box;\" \/><br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0ssl_certificate\u00a0\/etc\/ssl\/cert.pem;<br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0ssl_certificate_key\u00a0\/etc\/ssl\/key.pem;<br style=\"box-sizing: border-box;\" \/>}<br style=\"box-sizing: border-box;\" \/><br style=\"box-sizing: border-box;\" \/><\/code><\/pre>\n<h3 style=\"box-sizing: border-box; margin-top: 30px; margin-bottom: 15px; color: #000000; font-weight: bold; font-size: 20px; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; text-align: left; white-space: normal; background-color: #ffffff;\"><span style=\"box-sizing: border-box;\">\u914d\u7f6e\u6587\u4ef6\u7ed3\u6784<\/span><\/h3>\n<p style=\"box-sizing: border-box; margin-bottom: 0px; font-size: 16px; padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #000000; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; text-align: left; white-space: normal; background-color: #ffffff;\">Nginx\u7684\u914d\u7f6e\u6587\u4ef6\u662f\u4e00\u4e2a\u6587\u672c\u6587\u4ef6\uff0c\u5b83\u7531\u591a\u4e2a\u6307\u4ee4\u7ec4\u6210\uff0c\u6bcf\u4e2a\u6307\u4ee4\u7531\u4e00\u4e2a\u6216\u591a\u4e2a\u53c2\u6570\u7ec4\u6210\u3002\u6307\u4ee4\u53ef\u4ee5\u5305\u542b\u5757\uff0c\u5757\u4e2d\u5305\u542b\u5176\u4ed6\u6307\u4ee4\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u793a\u4f8b\uff1a<\/p>\n<pre style=\"box-sizing: border-box; font-size: 16px; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin-top: 10px; margin-bottom: 10px; overflow: auto; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px; color: #000000; text-align: left; background-color: #ffffff;\"><code style=\"box-sizing: border-box; font-size: 12px; font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; display: -webkit-box; overflow-x: auto; padding: 15px 16px 16px; color: #abb2bf; background: #282c34; border-radius: 5px;\">user\u00a0nginx;<br style=\"box-sizing: border-box;\" \/>worker_processes\u00a0auto;<br style=\"box-sizing: border-box;\" \/>error_log\u00a0\/var\/<span style=\"box-sizing: border-box; color: #e6c07b; line-height: 26px;\">log<\/span>\/nginx\/error.log;<br style=\"box-sizing: border-box;\" \/>pid\u00a0\/run\/nginx.pid;<br style=\"box-sizing: border-box;\" \/><br style=\"box-sizing: border-box;\" \/>events\u00a0{<br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0worker_connections\u00a01024;<br style=\"box-sizing: border-box;\" \/>}<br style=\"box-sizing: border-box;\" \/><br style=\"box-sizing: border-box;\" \/>http\u00a0{<br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0include\u00a0\/etc\/nginx\/mime.types;<br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0default_type\u00a0application\/octet-stream;<br style=\"box-sizing: border-box;\" \/><br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0log_format\u00a0main\u00a0<span style=\"box-sizing: border-box; color: #98c379; line-height: 26px;\">'$remote_addr\u00a0-\u00a0$remote_user\u00a0[$time_local]\u00a0\"$request\"\u00a0'<\/span><br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"box-sizing: border-box; color: #98c379; line-height: 26px;\">'$status\u00a0$body_bytes_sent\u00a0\"$http_referer\"\u00a0'<\/span><br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"box-sizing: border-box; color: #98c379; line-height: 26px;\">'\"$http_user_agent\"\u00a0\"$http_x_forwarded_for\"'<\/span>;<br style=\"box-sizing: border-box;\" \/><br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0access_log\u00a0\/var\/<span style=\"box-sizing: border-box; color: #e6c07b; line-height: 26px;\">log<\/span>\/nginx\/access.log\u00a0main;<br style=\"box-sizing: border-box;\" \/><br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0sendfile\u00a0on;<br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0tcp_nopush\u00a0on;<br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0tcp_nodelay\u00a0on;<br style=\"box-sizing: border-box;\" \/><br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0keepalive_timeout\u00a065;<br style=\"box-sizing: border-box;\" \/><br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0server\u00a0{<br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0listen\u00a080;<br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0server_name\u00a0example.com;<br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0root\u00a0\/var\/www\/example;<br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0}<br style=\"box-sizing: border-box;\" \/>}<br style=\"box-sizing: border-box;\" \/><br style=\"box-sizing: border-box;\" \/><\/code><\/pre>\n<h3 style=\"box-sizing: border-box; margin-top: 30px; margin-bottom: 15px; color: #000000; font-weight: bold; font-size: 20px; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; text-align: left; white-space: normal; background-color: #ffffff;\"><span style=\"box-sizing: border-box;\">Nginx\u7684\u91cd\u8f7d\u548c\u91cd\u542f<\/span><\/h3>\n<p style=\"box-sizing: border-box; margin-bottom: 0px; font-size: 16px; padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #000000; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; text-align: left; white-space: normal; background-color: #ffffff;\">\u5f53\u60a8\u4fee\u6539Nginx\u7684\u914d\u7f6e\u6587\u4ef6\u540e\uff0c\u60a8\u9700\u8981\u91cd\u8f7d\u6216\u91cd\u542fNginx\u670d\u52a1\u5668\uff0c\u4ee5\u4fbf\u4f7f\u66f4\u6539\u751f\u6548\u3002\u91cd\u8f7dNginx\u53ef\u4ee5\u5728\u4e0d\u4e2d\u65ad\u670d\u52a1\u7684\u60c5\u51b5\u4e0b\u91cd\u65b0\u52a0\u8f7d\u914d\u7f6e\u6587\u4ef6\uff0c\u800c\u91cd\u542fNginx\u4f1a\u4e2d\u65ad\u670d\u52a1\uff0c\u5e76\u91cd\u65b0\u52a0\u8f7d\u914d\u7f6e\u6587\u4ef6\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u57fa\u672c\u7684\u547d\u4ee4\uff1a<\/p>\n<pre style=\"box-sizing: border-box; font-size: 16px; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin-top: 10px; margin-bottom: 10px; overflow: auto; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px; color: #000000; text-align: left; background-color: #ffffff;\"><code style=\"box-sizing: border-box; font-size: 12px; font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; display: -webkit-box; overflow-x: auto; padding: 15px 16px 16px; color: #abb2bf; background: #282c34; border-radius: 5px;\"><span style=\"box-sizing: border-box; color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u91cd\u8f7dNginx<\/span><br style=\"box-sizing: border-box;\" \/>sudo\u00a0nginx\u00a0-s\u00a0reload<br style=\"box-sizing: border-box;\" \/><br style=\"box-sizing: border-box;\" \/><span style=\"box-sizing: border-box; color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u91cd\u542fNginx<\/span><br style=\"box-sizing: border-box;\" \/>sudo\u00a0systemctl\u00a0restart\u00a0nginx<br style=\"box-sizing: border-box;\" \/><br style=\"box-sizing: border-box;\" \/><\/code><\/pre>\n<h2 style=\"box-sizing: border-box; margin-top: 30px; margin-bottom: 15px; color: #000000; font-weight: bold; font-size: 22px; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; text-align: left; white-space: normal; background-color: #ffffff;\"><span style=\"box-sizing: border-box;\">Nginx\u7684\u8d1f\u8f7d\u5747\u8861\u548c\u53cd\u5411\u4ee3\u7406<\/span><\/h2>\n<p style=\"box-sizing: border-box; margin-bottom: 0px; font-size: 16px; padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #000000; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; text-align: left; white-space: normal; background-color: #ffffff;\">Nginx\u7684\u8d1f\u8f7d\u5747\u8861\u529f\u80fd\u53ef\u4ee5\u5e2e\u52a9\u60a8\u5c06\u8bf7\u6c42\u5206\u53d1\u5230\u591a\u4e2a\u540e\u7aef\u670d\u52a1\u5668\u4e0a\uff0c\u4ece\u800c\u5b9e\u73b0\u9ad8\u53ef\u7528\u6027\u548c\u6027\u80fd\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528\u591a\u79cd\u8d1f\u8f7d\u5747\u8861\u7b97\u6cd5\u6765\u6ee1\u8db3\u4e0d\u540c\u7684\u9700\u6c42\u3002\u53e6\u5916\uff0cNginx\u8fd8\u53ef\u4ee5\u4f5c\u4e3a\u53cd\u5411\u4ee3\u7406\u670d\u52a1\u5668\u6765\u4fdd\u62a4\u540e\u7aef\u670d\u52a1\u5668\uff0c\u5e76\u63d0\u4f9b\u66f4\u597d\u7684\u5b89\u5168\u6027\u548c\u6027\u80fd\u3002<\/p>\n<h3 style=\"box-sizing: border-box; margin-top: 30px; margin-bottom: 15px; color: #000000; font-weight: bold; font-size: 20px; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; text-align: left; white-space: normal; background-color: #ffffff;\"><span style=\"box-sizing: border-box;\">\u8d1f\u8f7d\u5747\u8861\u7b97\u6cd5<\/span><\/h3>\n<p style=\"box-sizing: border-box; margin-bottom: 0px; font-size: 16px; padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #000000; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; text-align: left; white-space: normal; background-color: #ffffff;\">Nginx\u63d0\u4f9b\u4e86\u591a\u79cd\u8d1f\u8f7d\u5747\u8861\u7b97\u6cd5\uff0c\u5305\u62ec\u8f6e\u8be2\u3001IP\u54c8\u5e0c\u3001\u6700\u5c11\u8fde\u63a5\u6570\u548c\u6743\u91cd\u7b49\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u57fa\u672c\u7684\u914d\u7f6e\uff1a<\/p>\n<pre style=\"box-sizing: border-box; font-size: 16px; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin-top: 10px; margin-bottom: 10px; overflow: auto; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px; color: #000000; text-align: left; background-color: #ffffff;\"><code style=\"box-sizing: border-box; font-size: 12px; font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; display: -webkit-box; overflow-x: auto; padding: 15px 16px 16px; color: #abb2bf; background: #282c34; border-radius: 5px;\">upstream\u00a0backend\u00a0{<br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0server\u00a0backend1.example.com;<br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0server\u00a0backend2.example.com;<br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0server\u00a0backend3.example.com;<br style=\"box-sizing: border-box;\" \/><br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0<span style=\"box-sizing: border-box; color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u8f6e\u8be2<\/span><br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0<span style=\"box-sizing: border-box; color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u9ed8\u8ba4\u7b97\u6cd5\uff0c\u6839\u636e\u8bf7\u6c42\u4f9d\u6b21\u5206\u914d\u5230\u6bcf\u4e2a\u540e\u7aef\u670d\u52a1\u5668<\/span><br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0<span style=\"box-sizing: border-box; color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u6bcf\u4e2a\u540e\u7aef\u670d\u52a1\u5668\u7684\u8bf7\u6c42\u6b21\u6570\u76f8\u7b49<\/span><br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0<span style=\"box-sizing: border-box; color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u6bcf\u4e2a\u540e\u7aef\u670d\u52a1\u5668\u7684\u5e76\u53d1\u8fde\u63a5\u6570\u76f8\u7b49<\/span><br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0<span style=\"box-sizing: border-box; color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u6bcf\u4e2a\u540e\u7aef\u670d\u52a1\u5668\u7684\u8d1f\u8f7d\u5747\u8861\u7cfb\u6570\u76f8\u7b49<\/span><br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0<span style=\"box-sizing: border-box; color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u6bcf\u4e2a\u540e\u7aef\u670d\u52a1\u5668\u7684\u54cd\u5e94\u65f6\u95f4\u76f8\u7b49<\/span><br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0<span style=\"box-sizing: border-box; color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u6bcf\u4e2a\u540e\u7aef\u670d\u52a1\u5668\u7684\u72b6\u6001\u76f8\u7b49<\/span><br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0<span style=\"box-sizing: border-box; color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u4e0b\u9762\u7684\u914d\u7f6e\u7b49\u540c\u4e8e\u00a0round-robin<\/span><br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0<span style=\"box-sizing: border-box; color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u4e5f\u53ef\u4ee5\u5199\u6210\u00a0balance\u00a0round-robin;<\/span><br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0<span style=\"box-sizing: border-box; color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0round-robin;<\/span><br style=\"box-sizing: border-box;\" \/><br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0<span style=\"box-sizing: border-box; color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0IP\u54c8\u5e0c<\/span><br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0<span style=\"box-sizing: border-box; color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u6839\u636e\u5ba2\u6237\u7aefIP\u5730\u5740\u7684\u54c8\u5e0c\u503c\u5206\u914d\u5230\u540e\u7aef\u670d\u52a1\u5668<\/span><br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0<span style=\"box-sizing: border-box; color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u76f8\u540cIP\u5730\u5740\u7684\u5ba2\u6237\u7aef\u603b\u662f\u88ab\u5206\u914d\u5230\u540c\u4e00\u4e2a\u540e\u7aef\u670d\u52a1\u5668<\/span><br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0<span style=\"box-sizing: border-box; color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u5185\u5b58\u4e2d\u9700\u8981\u7ef4\u62a4IP\u5730\u5740\u548c\u540e\u7aef\u670d\u52a1\u5668\u7684\u6620\u5c04\u8868<\/span><br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0<span style=\"box-sizing: border-box; color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0ip_hash;<\/span><br style=\"box-sizing: border-box;\" \/><br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0<span style=\"box-sizing: border-box; color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u6700\u5c11\u8fde\u63a5\u6570<\/span><br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0<span style=\"box-sizing: border-box; color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u6839\u636e\u540e\u7aef\u670d\u52a1\u5668\u7684\u5e76\u53d1\u8fde\u63a5\u6570\u5206\u914d\u5230\u6700\u7a7a\u95f2\u7684\u670d\u52a1\u5668<\/span><br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0<span style=\"box-sizing: border-box; color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u7ef4\u62a4\u6bcf\u4e2a\u540e\u7aef\u670d\u52a1\u5668\u7684\u5e76\u53d1\u8fde\u63a5\u6570<\/span><br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0<span style=\"box-sizing: border-box; color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0least_conn;<\/span><br style=\"box-sizing: border-box;\" \/><br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0<span style=\"box-sizing: border-box; color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u6743\u91cd<\/span><br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0<span style=\"box-sizing: border-box; color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u6839\u636e\u540e\u7aef\u670d\u52a1\u5668\u7684\u6743\u91cd\u5206\u914d\u5230\u670d\u52a1\u5668<\/span><br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0<span style=\"box-sizing: border-box; color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u6743\u91cd\u8d8a\u9ad8\u7684\u670d\u52a1\u5668\u88ab\u5206\u914d\u5230\u7684\u6982\u7387\u8d8a\u5927<\/span><br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0<span style=\"box-sizing: border-box; color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0weight=0\u8868\u793a\u670d\u52a1\u5668\u4e0d\u53c2\u4e0e\u8d1f\u8f7d\u5747\u8861<\/span><br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0<span style=\"box-sizing: border-box; color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0weight=1\u8868\u793a\u670d\u52a1\u5668\u6b63\u5e38\u53c2\u4e0e\u8d1f\u8f7d\u5747\u8861<\/span><br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0<span style=\"box-sizing: border-box; color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0weight=2\u8868\u793a\u670d\u52a1\u5668\u88ab\u5206\u914d\u5230\u7684\u6982\u7387\u662f\u5176\u4ed6\u670d\u52a1\u5668\u7684\u4e24\u500d<\/span><br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0<span style=\"box-sizing: border-box; color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0weight=3\u8868\u793a\u670d\u52a1\u5668\u88ab\u5206\u914d\u5230\u7684\u6982\u7387\u662f\u5176\u4ed6\u670d\u52a1\u5668\u7684\u4e09\u500d<\/span><br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0<span style=\"box-sizing: border-box; color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0weight;<\/span><br style=\"box-sizing: border-box;\" \/>}<br style=\"box-sizing: border-box;\" \/><br style=\"box-sizing: border-box;\" \/>server\u00a0{<br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0listen\u00a080;<br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0server_name\u00a0example.com;<br style=\"box-sizing: border-box;\" \/><br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0location\u00a0\/\u00a0{<br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0proxy_pass\u00a0&lt;http:\/\/backend&gt;;<br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0}<br style=\"box-sizing: border-box;\" \/>}<br style=\"box-sizing: border-box;\" \/><br style=\"box-sizing: border-box;\" \/><\/code><\/pre>\n<h3 style=\"box-sizing: border-box; margin-top: 30px; margin-bottom: 15px; color: #000000; font-weight: bold; font-size: 20px; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; text-align: left; white-space: normal; background-color: #ffffff;\"><span style=\"box-sizing: border-box;\">\u53cd\u5411\u4ee3\u7406<\/span><\/h3>\n<p style=\"box-sizing: border-box; margin-bottom: 0px; font-size: 16px; padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #000000; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; text-align: left; white-space: normal; background-color: #ffffff;\">Nginx\u53ef\u4ee5\u4f5c\u4e3a\u53cd\u5411\u4ee3\u7406\u670d\u52a1\u5668\u6765\u4fdd\u62a4\u540e\u7aef\u670d\u52a1\u5668\uff0c\u5e76\u63d0\u4f9b\u66f4\u597d\u7684\u5b89\u5168\u6027\u548c\u6027\u80fd\u3002\u53cd\u5411\u4ee3\u7406\u670d\u52a1\u5668\u63a5\u6536\u5ba2\u6237\u7aef\u7684\u8bf7\u6c42\uff0c\u7136\u540e\u5c06\u8bf7\u6c42\u8f6c\u53d1\u5230\u540e\u7aef\u670d\u52a1\u5668\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u57fa\u672c\u7684\u914d\u7f6e\uff1a<\/p>\n<pre style=\"box-sizing: border-box; font-size: 16px; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin-top: 10px; margin-bottom: 10px; overflow: auto; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px; color: #000000; text-align: left; background-color: #ffffff;\"><code style=\"box-sizing: border-box; font-size: 12px; font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; display: -webkit-box; overflow-x: auto; padding: 15px 16px 16px; color: #abb2bf; background: #282c34; border-radius: 5px;\">server\u00a0{<br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0listen\u00a080;<br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0server_name\u00a0example.com;<br style=\"box-sizing: border-box;\" \/><br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0location\u00a0\/\u00a0{<br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0proxy_pass\u00a0&lt;http:\/\/backend&gt;;<br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0proxy_set_header\u00a0Host\u00a0<span style=\"box-sizing: border-box; color: #d19a66; line-height: 26px;\">$host<\/span>;<br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0proxy_set_header\u00a0X-Real-IP\u00a0<span style=\"box-sizing: border-box; color: #d19a66; line-height: 26px;\">$remote_addr<\/span>;<br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0proxy_set_header\u00a0X-Forwarded-For\u00a0<span style=\"box-sizing: border-box; color: #d19a66; line-height: 26px;\">$proxy_add_x_forwarded_for<\/span>;<br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0}<br style=\"box-sizing: border-box;\" \/>}<br style=\"box-sizing: border-box;\" \/><br style=\"box-sizing: border-box;\" \/><\/code><\/pre>\n<h2 style=\"box-sizing: border-box; margin-top: 30px; margin-bottom: 15px; color: #000000; font-weight: bold; font-size: 22px; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; text-align: left; white-space: normal; background-color: #ffffff;\"><span style=\"box-sizing: border-box;\">Nginx\u7684\u9ad8\u7ea7\u529f\u80fd<\/span><\/h2>\n<p style=\"box-sizing: border-box; margin-bottom: 0px; font-size: 16px; padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #000000; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; text-align: left; white-space: normal; background-color: #ffffff;\">\u9664\u4e86\u57fa\u672c\u7684\u529f\u80fd\u4e4b\u5916\uff0cNginx\u8fd8\u63d0\u4f9b\u4e86\u8bb8\u591a\u9ad8\u7ea7\u529f\u80fd\uff0c\u5982\u52a8\u6001\u6a21\u5757\u548c\u7f13\u5b58\u63a7\u5236\u7b49\u3002\u52a8\u6001\u6a21\u5757\u53ef\u4ee5\u5e2e\u52a9\u60a8\u6269\u5c55Nginx\u7684\u529f\u80fd\uff0c\u4ece\u800c\u6ee1\u8db3\u66f4\u591a\u7684\u9700\u6c42\u3002\u800c\u7f13\u5b58\u63a7\u5236\u529f\u80fd\u53ef\u4ee5\u5e2e\u52a9\u60a8\u63d0\u9ad8Web\u5e94\u7528\u7a0b\u5e8f\u7684\u6027\u80fd\uff0c\u51cf\u5c11\u52a0\u8f7d\u65f6\u95f4\u548c\u5e26\u5bbd\u6d88\u8017\u3002<\/p>\n<h3 style=\"box-sizing: border-box; margin-top: 30px; margin-bottom: 15px; color: #000000; font-weight: bold; font-size: 20px; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; text-align: left; white-space: normal; background-color: #ffffff;\"><span style=\"box-sizing: border-box;\">\u52a8\u6001\u6a21\u5757<\/span><\/h3>\n<p style=\"box-sizing: border-box; margin-bottom: 0px; font-size: 16px; padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #000000; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; text-align: left; white-space: normal; background-color: #ffffff;\">Nginx\u652f\u6301\u52a8\u6001\u6a21\u5757\uff0c\u53ef\u4ee5\u901a\u8fc7\u52a8\u6001\u6a21\u5757\u6269\u5c55Nginx\u7684\u529f\u80fd\u3002\u52a8\u6001\u6a21\u5757\u662f\u4e8c\u8fdb\u5236\u6587\u4ef6\uff0c\u53ef\u4ee5\u5728\u8fd0\u884c\u65f6\u52a0\u8f7d\u5230Nginx\u4e2d\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u57fa\u672c\u7684\u914d\u7f6e\uff1a<\/p>\n<pre style=\"box-sizing: border-box; font-size: 16px; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin-top: 10px; margin-bottom: 10px; overflow: auto; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px; color: #000000; text-align: left; background-color: #ffffff;\"><code style=\"box-sizing: border-box; font-size: 12px; font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; display: -webkit-box; overflow-x: auto; padding: 15px 16px 16px; color: #abb2bf; background: #282c34; border-radius: 5px;\">load_module\u00a0\/path\/to\/module.so;<br style=\"box-sizing: border-box;\" \/><br style=\"box-sizing: border-box;\" \/><\/code><\/pre>\n<h3 style=\"box-sizing: border-box; margin-top: 30px; margin-bottom: 15px; color: #000000; font-weight: bold; font-size: 20px; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; text-align: left; white-space: normal; background-color: #ffffff;\"><span style=\"box-sizing: border-box;\">\u7f13\u5b58\u63a7\u5236<\/span><\/h3>\n<p style=\"box-sizing: border-box; margin-bottom: 0px; font-size: 16px; padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #000000; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; text-align: left; white-space: normal; background-color: #ffffff;\">Nginx\u63d0\u4f9b\u4e86\u591a\u79cd\u7f13\u5b58\u63a7\u5236\u529f\u80fd\uff0c\u5305\u62ec\u6d4f\u89c8\u5668\u7f13\u5b58\u548c\u53cd\u5411\u4ee3\u7406\u7f13\u5b58\u7b49\u3002\u7f13\u5b58\u63a7\u5236\u53ef\u4ee5\u5e2e\u52a9\u60a8\u63d0\u9ad8Web\u5e94\u7528\u7a0b\u5e8f\u7684\u6027\u80fd\uff0c\u51cf\u5c11\u52a0\u8f7d\u65f6\u95f4\u548c\u5e26\u5bbd\u6d88\u8017\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u57fa\u672c\u7684\u914d\u7f6e\uff1a<\/p>\n<pre style=\"box-sizing: border-box; font-size: 16px; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin-top: 10px; margin-bottom: 10px; overflow: auto; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px; color: #000000; text-align: left; background-color: #ffffff;\"><code style=\"box-sizing: border-box; font-size: 12px; font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; display: -webkit-box; overflow-x: auto; padding: 15px 16px 16px; color: #abb2bf; background: #282c34; border-radius: 5px;\"><span style=\"box-sizing: border-box; color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u6d4f\u89c8\u5668\u7f13\u5b58<\/span><br style=\"box-sizing: border-box;\" \/>location\u00a0\/\u00a0{<br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0expires\u00a01h;<br style=\"box-sizing: border-box;\" \/>}<br style=\"box-sizing: border-box;\" \/><br style=\"box-sizing: border-box;\" \/><span style=\"box-sizing: border-box; color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u53cd\u5411\u4ee3\u7406\u7f13\u5b58<\/span><br style=\"box-sizing: border-box;\" \/>proxy_cache_path\u00a0\/path\/to\/cache\u00a0levels=1:2\u00a0keys_zone=my_cache:10m;<br style=\"box-sizing: border-box;\" \/>server\u00a0{<br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0listen\u00a080;<br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0server_name\u00a0example.com;<br style=\"box-sizing: border-box;\" \/><br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0location\u00a0\/\u00a0{<br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0proxy_pass\u00a0&lt;http:\/\/backend&gt;;<br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0proxy_cache\u00a0my_cache;<br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0proxy_cache_valid\u00a0200\u00a01h;<br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0proxy_cache_valid\u00a0404\u00a01m;<br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0proxy_cache_bypass\u00a0<span style=\"box-sizing: border-box; color: #d19a66; line-height: 26px;\">$http_pragma<\/span>;<br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0proxy_cache_revalidate\u00a0on;<br style=\"box-sizing: border-box;\" \/>\u00a0\u00a0\u00a0\u00a0}<br style=\"box-sizing: border-box;\" \/>}<br style=\"box-sizing: border-box;\" \/><br style=\"box-sizing: border-box;\" \/><\/code><\/pre>\n<h2 style=\"box-sizing: border-box; margin-top: 30px; margin-bottom: 15px; color: #000000; font-weight: bold; font-size: 22px; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; text-align: left; white-space: normal; background-color: #ffffff;\"><span style=\"box-sizing: border-box;\">\u603b\u7ed3<\/span><\/h2>\n<p style=\"box-sizing: border-box; margin-bottom: 0px; font-size: 16px; padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: #000000; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; text-align: left; white-space: normal; background-color: #ffffff;\">Nginx\u662f\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u7684Web\u670d\u52a1\u5668\uff0c\u5b83\u53ef\u4ee5\u5e2e\u52a9\u60a8\u5b9e\u73b0\u9ad8\u53ef\u7528\u6027\u548c\u6027\u80fd\u3002\u5728\u672c\u7bc7\u535a\u6587\u4e2d\uff0c\u6211\u4eec\u4ecb\u7ecd\u4e86Nginx\u7684\u57fa\u672c\u5b89\u88c5\u548c\u914d\u7f6e\u65b9\u6cd5\uff0c\u4ee5\u53ca\u5982\u4f55\u4f7f\u7528\u5b83\u8fdb\u884c\u8d1f\u8f7d\u5747\u8861\u548c\u53cd\u5411\u4ee3\u7406\u3002\u9664\u6b64\u4e4b\u5916\uff0c\u6211\u4eec\u8fd8\u63a2\u8ba8\u4e86Nginx\u7684\u9ad8\u7ea7\u529f\u80fd\uff0c\u5982\u52a8\u6001\u6a21\u5757\u548c\u7f13\u5b58\u63a7\u5236\u7b49\u3002\u5e0c\u671b\u8fd9\u7bc7\u535a\u6587\u80fd\u5e2e\u52a9\u60a8\u66f4\u597d\u5730\u4e86\u89e3\u548c\u4f7f\u7528Nginx\u3002<\/p>\n<p style=\"display: none;\">\n<blockquote class=\"keep-source\"><p>\u539f\u6587\u59cb\u53d1\u4e8e\u5fae\u4fe1\u516c\u4f17\u53f7\uff08\u653b\u57ce\u72ee\u4e0d\u662f\u732b\uff09\uff1a<a href=\"http:\/\/mp.weixin.qq.com\/s\/94i2SwOfd27cgRhv7hSucg\" target=\"_blank\" rel=\"noopener\" rel=\"nofollow\" >Nginx\u5165\u95e8\u5230\u7cbe\u901a<\/a><\/p><\/blockquote>\n<\/div>\n","raw":"","protected":false},"excerpt":{"rendered":"<p>\u4ecb\u7ecd Nginx\u662f\u4e00\u4e2a\u9ad8\u6027\u80fd\u7684Web\u670d\u52a1\u5668\uff0c\u5b83\u53ef\u4ee5\u5904\u7406\u5927\u91cf\u7684\u5e76\u53d1\u8bf7\u6c42\uff0c\u540c\u65f6\u8fd8\u53ef\u4ee5\u4f5c\u4e3a\u8d1f\u8f7d\u5747\u8861\u5668\u548c\u53cd\u5411\u4ee3\u7406\u670d\u52a1\u5668\u3002\u5728\u672c\u7bc7\u535a\u6587\u4e2d\uff0c\u6211\u4eec &#8230;<\/p>\n","protected":false},"author":1,"featured_media":205,"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-204","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\/20230525134417660-150x150.jpeg","content_first_image":null,"post_medium_image_300":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230525134417660-300x128.jpeg","post_thumbnail_image_624":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230525134417660-1024x436.jpeg","post_frist_image":null,"post_medium_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230525134417660-300x128.jpeg","post_large_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230525134417660-1024x436.jpeg","post_full_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230525134417660.jpeg","post_all_images":[],"videoAdId":"","listAd":"0","listAdId":"","listAdEvery":6,"total_comments":0,"category_name":"Nginx","post_date":"2023-05-25","like_count":"1","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":[{"avatarurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230525140221253.jpg"}],"related_posts":null,"pageviews":346,"next_post_id":294,"next_post_title":"40\u4e2a Nginx \u5e38\u95ee\u9762\u8bd5\u9898","previous_post_id":320,"previous_post_title":"Nginx\u9650\u5236\u6bcf\u79d2\u8bf7\u6c42\u6b21\u6570\uff0c\u9650\u5236\u6bcf\u79d2\u8fde\u63a5\u6b21\u6570\uff0c\u4e0b\u8f7d\u901f\u5ea6\u9650\u5236","_links":{"self":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/204","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=204"}],"version-history":[{"count":0,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/204\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media\/205"}],"wp:attachment":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media?parent=204"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/categories?post=204"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/tags?post=204"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}