{"id":33392,"date":"2022-11-16T08:56:55","date_gmt":"2022-11-25T15:31:34","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%85%b3%e4%ba%8e%e6%af%8f%e4%b8%aa%e8%bd%af%e4%bb%b6%e5%8c%85%e7%9a%84nginx%e7%ad%be%e5%90%8d%e3%80%82\/"},"modified":"2024-04-29T00:55:12","modified_gmt":"2024-04-28T16:55:12","slug":"%e5%85%b3%e4%ba%8e%e6%af%8f%e4%b8%aa%e8%bd%af%e4%bb%b6%e5%8c%85%e7%9a%84nginx%e7%ad%be%e5%90%8d%e3%80%82","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%85%b3%e4%ba%8e%e6%af%8f%e4%b8%aa%e8%bd%af%e4%bb%b6%e5%8c%85%e7%9a%84nginx%e7%ad%be%e5%90%8d%e3%80%82\/","title":{"rendered":"\u5173\u4e8e\u6bcf\u4e2a\u8f6f\u4ef6\u5305\u7684nginx\u7b7e\u540d"},"content":{"rendered":"<h1>\u603b\u7ed3<\/h1>\n<p>\u4ece1.9.11\u7248\u672c\u5f00\u59cb\uff0cNginx\u53ef\u4ee5\u4f7f\u7528\u52a8\u6001\u6a21\u5757\u3002\u7136\u800c\uff0c\u5b58\u5728\u4e00\u4e2a\u9650\u5236\u6761\u4ef6\u5373\u5916\u90e8\u6a21\u5757\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6\u5fc5\u987b\u4e0eNginx\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6\u7b7e\u540d\u76f8\u540c\uff0c\u5426\u5219\u65e0\u6cd5\u6b63\u5e38\u8fd0\u884c\u3002\u8fd9\u4e00\u9650\u5236\u6761\u4ef6\u4e00\u76f4\u5b58\u5728\u81f3\u4eca\u3002<\/p>\n<p>\u4ece\u7248\u672c1.11.5\u5f00\u59cb\uff0c\u5f53\u8fdb\u884c.\/configure\u65f6\uff0c\u5c06\u652f\u6301&#8211;with-compat\u9009\u9879\uff0c\u5e76\u4e14\u542f\u7528\u6b64\u9009\u9879\u540e\uff0c\u4f7f\u7528nginx\u5b98\u65b9\u5206\u53d1\u7684nginx\u5728\u73af\u5883\u4e2d\u5c31\u4e0d\u518d\u6709\u95ee\u9898\u4e86\u3002\u7136\u800c\uff0c\u5bf9\u4e8e\u975e\u5b98\u65b9\u7684EPEL\u6216Ubuntu\u7684\u6807\u51c6\u4ed3\u5e93\u7b49\u5206\u53d1\u7684nginx\u4e8c\u8fdb\u5236\u6587\u4ef6\uff0c\u5e76\u4e0d\u80fd\u4e00\u6982\u800c\u8bba\uff0c\u4ecd\u7136\u9700\u8981\u81ea\u884c\u5206\u6790\u4e8c\u8fdb\u5236\u6587\u4ef6\u548cnginx -V\uff0c\u5e76\u9009\u62e9\u9002\u5f53\u7684configure\u9009\u9879\u8fdb\u884c\u6784\u5efa\uff0c\u8fd9\u79cd\u60c5\u51b5\u4ecd\u7136\u6301\u7eed\u5b58\u5728\u3002<\/p>\n<p>\u5728\u8003\u8651\u7b80\u5355\u7684\u60c5\u51b5\u4e0b\uff0c\u5982\u679c\u4f7f\u7528\u52a8\u6001\u6a21\u5757\uff0c\u5219\u4f7f\u7528\u5b98\u65b9\u7684Nginx\u4e8c\u8fdb\u5236\u6587\u4ef6\uff08\u6216\u8005\u81ea\u5df1\u6784\u5efaNginx\uff09\u53ef\u80fd\u662f\u6700\u4f73\u9009\u62e9\uff0c\u4f46\u6839\u636e\u8981\u6c42\uff0c\u53ef\u80fd\u9700\u8981\u4f7f\u7528\u5176\u4ed6\u4e8c\u8fdb\u5236\u6587\u4ef6\u3002<\/p>\n<p>\u5728\u8fd9\u91cc\uff0c\u6211\u60f3\u603b\u7ed3\u4e00\u4e0b\u9664\u4e86\u5b98\u65b9nginx\u4e8c\u8fdb\u5236\u6587\u4ef6\u4e4b\u5916\u7684nginx\u7b7e\u540d\u662f\u4ec0\u4e48\u6837\u7684\uff0c\u5e76\u7b80\u5355\u8bf4\u660e\u4e00\u4e0b\u5e94\u8be5\u6dfb\u52a0\u54ea\u4e9b\u9009\u9879\u3002<\/p>\n<h2>\u5728\u95b1\u8b80\u672c\u6587\u7ae0\u4e4b\u524d<\/h2>\n<p>\u5728\u5199\u8fd9\u7bc7\u6587\u7ae0\u7684\u65f6\u5019\uff0c\u53c2\u8003\u4e86Heartbeats\u7684\u535a\u5ba2\u6587\u7ae0\uff0c\u5bf9\u6211\u5f88\u6709\u5e2e\u52a9\u3002\u6211\u8ba4\u4e3a\u63d0\u524d\u9605\u8bfb\u4e00\u4e0b\u4f1a\u66f4\u52a0\u987a\u5229\u3002<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">nginx-1.9.11\u3067\u52d5\u7684\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u30b5\u30dd\u30fc\u30c8 &#8211; \u30a4\u30f3\u30d5\u30e9\u30a8\u30f3\u30b8\u30cb\u30a2way &#8211; Powered by HEARTBEATS<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">nginx\u306e\u52d5\u7684\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u6700\u65b0\u72b6\u6cc1\uff082017\u5e742\u6708\u7248\uff09 &#8211; \u30a4\u30f3\u30d5\u30e9\u30a8\u30f3\u30b8\u30cb\u30a2way &#8211; Powered by HEARTBEATS<\/ul>\n<h1>\u7b7e\u540d\u7684\u67e5\u627e\u65b9\u6cd5<\/h1>\n<p>\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c\u67e5\u8be2\uff0c\u6b63\u5982 Heart Beats \u6240\u63d0\u5230\u7684\u8be5\u547d\u4ee4\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span>strings \/usr\/sbin\/nginx | <span class=\"nb\">grep<\/span> <span class=\"s1\">'^.,.,.,'<\/span>\r\n<\/code><\/pre>\n<p>nginx\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6\u4f4d\u7f6e\u53ef\u80fd\u4f1a\u56e0\u73af\u5883\u800c\u5f02\u3002\u5c24\u5176\u662f\u50cfOpenResty\u8fd9\u6837\u7684\u975e\u5b98\u65b9\u4e8c\u8fdb\u5236\u6587\u4ef6\u901a\u5e38\u4f1a\u6709\u4e0d\u540c\u7684\u4f4d\u7f6e\uff08\u4f8b\u5982\/usr\/local\/openresty\/nginx\/sbin\/nginx\uff09\u3002<\/p>\n<h1>\u5404\u4e2a\u4e8c\u8fdb\u5236\u6587\u4ef6\u7684\u7b7e\u540d\u5217\u8868<\/h1>\n<ul class=\"post-ul\">\u672c\u9805\u306e\u5185\u5bb9\u306f\u3001\u9069\u5b9c\u8ffd\u52a0\u30fb\u66f4\u65b0\u3092\u3059\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002<\/ul>\n<h2>\u4e9a\u9a6c\u900aLinux 2\u73af\u5883<\/h2>\n<div>\n<div class=\"post-table\">\u30d1\u30c3\u30b1\u30fc\u30b8\uff08\u30d5\u30a1\u30a4\u30eb\u540d\u30fb\u30d1\u30c3\u30b1\u30fc\u30b8\u540d\uff09\u30ec\u30dd\u30b8\u30c8\u30ea\u30fb\u914d\u5e03\u5143signature\u5099\u8003\u30fb\u8aac\u660enginx-1.18.0-1.40.amzn1.x86_64.rpmamzn-updates8,4,8,0010111111010111001110111111111110<\/div>\n<\/div>\n<h2>\u4e9a\u9a6c\u900aLinux 2018\u73af\u5883\u4e2d\u7684Amazon Linux 1\u7248\u672c\u4e0eCentOS 6\u517c\u5bb9\u3002<\/h2>\n<div>\n<div class=\"post-table\">\u30d1\u30c3\u30b1\u30fc\u30b8\uff08\u30d5\u30a1\u30a4\u30eb\u540d\u30fb\u30d1\u30c3\u30b1\u30fc\u30b8\u540d\uff09\u30ec\u30dd\u30b8\u30c8\u30ea\u30fb\u914d\u5e03\u5143signature\u5099\u8003\u30fb\u8aac\u660enginx-1.18.0-1.el6.ngx.x86_64.rpm<a href=\"https:\/\/nginx.org\/\" target=\"_blank\" rel=\"nofollow noopener\">nginx\u516c\u5f0f<\/a>8,4,8,0011111111010011001111111111111111<\/div>\n<\/div>\n<h2>CentOS Linux 7.7.1908 (\u6838\u5fc3) \u53d1\u884c\u7248\u73af\u5883<\/h2>\n<div>\n<div class=\"post-table\">\u30d1\u30c3\u30b1\u30fc\u30b8\uff08\u30d5\u30a1\u30a4\u30eb\u540d\u30fb\u30d1\u30c3\u30b1\u30fc\u30b8\u540d\uff09\u30ec\u30dd\u30b8\u30c8\u30ea\u30fb\u914d\u5e03\u5143signature\u5099\u8003\u30fb\u8aac\u660enginx-1.16.1-1.el7.ngx.x86_64.rpm<a href=\"https:\/\/nginx.org\/\" target=\"_blank\" rel=\"nofollow noopener\">nginx\u516c\u5f0f<\/a>8,4,8,0011111111010111001111111111111111<br \/>\nnginx-1.16.1-1.el7.x86_64.rpm<a href=\"https:\/\/fedoraproject.org\/wiki\/EPEL\/ja\" target=\"_blank\" rel=\"nofollow noopener\">epel<\/a>8,4,8,0010111111010111001110111111111110<br \/>\nopenresty-1.15.8.2-6.el7.x86_64.rpm<a href=\"https:\/\/openresty.org\/en\/\" target=\"_blank\" rel=\"nofollow noopener\">openresty<\/a>8,4,8,0000111111010111001111111111111110<br \/>\nkong-2.0.1.el7.amd64.rpm<a href=\"https:\/\/konghq.com\/\" target=\"_blank\" rel=\"nofollow noopener\">kong<\/a>8,4,8,0000111111010111001110111111110110Kong\u306b\u542b\u307e\u308c\u308bnginx\u306fOpenResty\u3002\u30d0\u30fc\u30b8\u30e7\u30f3\u30821.15.8.2\u3002<\/div>\n<\/div>\n<h2>Ubuntu 18.04.4 LTS\uff08Bionic Beaver\uff09\u73af\u5883<\/h2>\n<div>\n<div class=\"post-table\">\u30d1\u30c3\u30b1\u30fc\u30b8\uff08\u30d5\u30a1\u30a4\u30eb\u540d\u30fb\u30d1\u30c3\u30b1\u30fc\u30b8\u540d\uff09\u30ec\u30dd\u30b8\u30c8\u30ea\u30fb\u914d\u5e03\u5143signature\u5099\u8003\u30fb\u8aac\u660e1.16.1-1~bionic<a href=\"https:\/\/nginx.org\/\" target=\"_blank\" rel=\"nofollow noopener\">nginx\u516c\u5f0f<\/a>8,4,8,0011111111010111001111111111111111<br \/>\n1.14.0-0ubuntu1.7<a href=\"https:\/\/ubuntu.com\/\" target=\"_blank\" rel=\"nofollow noopener\">ubuntu\u516c\u5f0f<\/a>8,4,8,0000111111010111001111111111111110<\/div>\n<\/div>\n<h2>Windows version -&gt; Windows\u7248\u672c<\/h2>\n<div>\n<div class=\"post-table\">\u30d1\u30c3\u30b1\u30fc\u30b8\uff08\u30d5\u30a1\u30a4\u30eb\u540d\u30fb\u30d1\u30c3\u30b1\u30fc\u30b8\u540d\uff09\u30ec\u30dd\u30b8\u30c8\u30ea\u30fb\u914d\u5e03\u5143signature\u5099\u8003\u30fb\u8aac\u660enginx-1.16.1.zip<a href=\"https:\/\/nginx.org\/\" target=\"_blank\" rel=\"nofollow noopener\">nginx\u516c\u5f0f<\/a>4,4,4,0100000111010001000100111111111110<\/div>\n<\/div>\n<h2>\u82f9\u679c\u64cd\u4f5c\u7cfb\u7edf\u7684\u7248\u672c<\/h2>\n<div>\n<div class=\"post-table\">\u30d1\u30c3\u30b1\u30fc\u30b8\uff08\u30d5\u30a1\u30a4\u30eb\u540d\u30fb\u30d1\u30c3\u30b1\u30fc\u30b8\u540d\uff09\u30ec\u30dd\u30b8\u30c8\u30ea\u30fb\u914d\u5e03\u5143signature\u5099\u8003\u30fb\u8aac\u660enginx: stable 1.19.2 (bottled), HEADhomebrew8,4,8,1011000111010111001101111111111111<\/div>\n<\/div>\n<h1>\u4e3a\u4e86\u9002\u5e94\u76ee\u6807signature\uff0c\u53ef\u4ee5\u4f7f\u7528configure\u9009\u9879\u3002<\/h1>\n<p>\u5728nginx\u6e90\u7801\u76ee\u5f55\u4e2d\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u6765\u6784\u5efa\u52a8\u6001\u6a21\u5757\u3002\u5047\u8bbe\u5728\u6b64\u8fc7\u7a0b\u4e2d\u5df2\u7ecf\u5b89\u88c5\u4e86\u5fc5\u8981\u7684\u6784\u5efa\u5305\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span>.\/configure <span class=\"nt\">--add-dynamic-module<\/span><span class=\"o\">=<\/span>&lt;\u52d5\u7684\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30bd\u30fc\u30b9\u306e\u30d1\u30b9\u3092\u6307\u5b9a&gt;\r\n<span class=\"nv\">$ <\/span>make modules\r\n<\/code><\/pre>\n<p>\u968f\u540e\uff0c\u5728\u76f8\u540c\u7684\u76ee\u5f55\u4e2d\u7684objs\u76ee\u5f55\u4e0b\u4f1a\u751f\u6210ngx_????.so\u6587\u4ef6\uff0c\u7136\u540e\u5c06\u5176\u79fb\u52a8\u5230\u9002\u5f53\u7684\u4f4d\u7f6e\uff0c\u4ee5\u4f9bnginx\u52a0\u8f7d\u3002<\/p>\n<p>\u5982\u679c\u6ca1\u6709\u8003\u8651\u4efb\u4f55\u4e8b\u60c5\uff0cconfigure\u6267\u884c\u65f6\u7684\u9009\u9879\u5c06\u7531\u64cd\u4f5c\u7cfb\u7edf\u7684\u8bbe\u7f6e\u548c\u5df2\u5b89\u88c5\u7684\u5e93\u7b49\u81ea\u52a8\u786e\u5b9a\u3002\u5c06nginx\u4e8c\u8fdb\u5236\u6587\u4ef6\u548c\u52a8\u6001\u6a21\u5757\u7684\u7b7e\u540d\u8fdb\u884c\u5339\u914d\uff0c\u5c31\u662f\u5728\u68c0\u67e5configure\u7684\u9009\u9879\u540e\u8fdb\u884c\u8c03\u6574\u7684\u5fc5\u8981\u6027\u3002<\/p>\n<p>\u987a\u4fbf\u8bf4\u4e00\u53e5\uff0c\u5728\u6211\u7684\u5de5\u4f5c\u73af\u5883\u4e2d\uff0c\u5982\u679c\u4f7f\u7528\u4e0a\u8ff0\u547d\u4ee4\u800c\u4e0d\u6dfb\u52a0\u4efb\u4f55\u9009\u9879\u8fdb\u884c\u6784\u5efa\uff0c\u52a8\u6001\u6a21\u5757\u7684\u7b7e\u540d\u5c06\u5982\u4e0b\u6240\u793a\u3002\u5c3d\u7ba1\u5b57\u7b26\u4e32\u6709\u70b9\u957f\uff0c\u5728\u9875\u9762\u5185\u8fdb\u884c\u641c\u7d22\u4e5f\u53ef\u4ee5\u53d1\u73b0\u4e0e\u4e0a\u8ff0\u4efb\u4f55\u7b7e\u540d\u90fd\u4e0d\u540c\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u4e0e\u4e0a\u8ff0\u7684\u4efb\u4f55nginx\u4e8c\u8fdb\u5236\u6587\u4ef6\u7ed3\u5408\u4f7f\u7528\u90fd\u5c06\u65e0\u6cd5\u8fd0\u884c\uff0c\u8fd9\u5c06\u5bfc\u81f4\u751f\u6210\u4e00\u79cd\u5b8c\u5168\u65e0\u7528\u7684\u52a8\u6001\u6a21\u5757\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6\u3002<\/p>\n<pre class=\"post-pre\"><code>8,4,8,0000111111010111001110101111000110\r\n<\/code><\/pre>\n<p>\u4e0d\u4ec5\u9650\u4e8enginx\uff0c\u4e00\u822c\u6765\u8bf4\uff0c\u901a\u8fc7\u4f7f\u7528$ .\/configure &#8211;help\u547d\u4ee4\u53ef\u4ee5\u5927\u81f4\u4e86\u89e3configure\u9009\u9879\u3002\u6b63\u5982Heartbeats\u5148\u751f\u5728\u535a\u5ba2\u4e2d\u6240\u8ff0\uff0c\u6570\u5b57\u7b7e\u540d\u7684\u5e8f\u5217\u662f\u6784\u5efa\u65f6\u4f7f\u7528\u7684\u9009\u9879\u6807\u5fd7\uff0c\u53ef\u4ee5\u4ece\u8fd9\u91cc\u4e86\u89e3\u54ea\u4e9b\u9009\u9879\u662f\u542f\u7528\u6216\u7981\u7528\u7684\u3002<\/p>\n<p>\u6700\u540e\uff0c\u6839\u636e\u914d\u7f6e\u60c5\u51b5\u9009\u62e9configure\u9009\u9879\u3002\u4f46\u662f\uff0c\u6709\u4e00\u4e9b\u9009\u9879\u4e0d\u65b9\u4fbf\u76f4\u63a5\u6307\u5b9a\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u53ef\u4ee5\u4f7f\u7528&#8211;with-cc-opt\u8fdb\u884c\u6dfb\u52a0\u3002<\/p>\n<p>\u4f8b\u5982\uff0c\u8981\u4e0ekong-2.0.1.el7.amd64.rpm\u4e2d\u5305\u542b\u7684nginx\u4e8c\u8fdb\u5236\u6587\u4ef6\u7684\u7b7e\u540d\u76f8\u5339\u914d\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u9009\u9879\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span>.\/configure <span class=\"nt\">--add-dynamic-module<\/span><span class=\"o\">=<\/span>&lt;\u52d5\u7684\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30bd\u30fc\u30b9\u306e\u30d1\u30b9\u3092\u6307\u5b9a\u3057\u3066\u306d&gt; <span class=\"se\">\\<\/span>\r\n  <span class=\"nt\">--with-http_realip_module<\/span> <span class=\"se\">\\<\/span>\r\n  <span class=\"nt\">--with-http_ssl_module<\/span> <span class=\"se\">\\<\/span>\r\n  <span class=\"nt\">--with-cc-opt<\/span><span class=\"o\">=<\/span><span class=\"s1\">'-DNGX_HTTP_HEADERS'<\/span>\r\n<\/code><\/pre>\n<h2>\u66f4\u7b80\u5355\u7684\u65b9\u6cd5\uff082020-09-20\u8865\u5145\uff09<\/h2>\n<p>\u5f53\u5728\u6267\u884cnginx\u547d\u4ee4\u65f6\u6dfb\u52a0-V\u9009\u9879\uff0c\u5c06\u4f1a\u663e\u793a\u8be5nginx\u7f16\u8bd1\u65f6\u6240\u4f7f\u7528\u7684\u9009\u9879\u3002\u867d\u7136\u6709\u70b9\u957f\uff0c\u53ef\u80fd\u4f1a\u8d85\u51fa\u53f3\u8fb9\u7684\u8303\u56f4\uff0c\u4e0d\u8fc7\u6211\u4eec\u8fd8\u662f\u76f4\u63a5\u7c98\u8d34\u8bd5\u8bd5\uff08\u6b64\u5904\u662f\u5728Mac\u4e0a\u4f7f\u7528Homebrew\u5b89\u88c5\u7684nginx\u8fdb\u884c\u5c1d\u8bd5\uff09\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span>nginx <span class=\"nt\">-V<\/span>\r\nnginx version: nginx\/1.19.2\r\nbuilt by clang 11.0.3 <span class=\"o\">(<\/span>clang-1103.0.32.62<span class=\"o\">)<\/span>\r\nbuilt with OpenSSL 1.1.1g  21 Apr 2020\r\nTLS SNI support enabled\r\nconfigure arguments: <span class=\"nt\">--prefix<\/span><span class=\"o\">=<\/span>\/usr\/local\/Cellar\/nginx\/1.19.2 <span class=\"nt\">--sbin-path<\/span><span class=\"o\">=<\/span>\/usr\/local\/Cellar\/nginx\/1.19.2\/bin\/nginx <span class=\"nt\">--with-cc-opt<\/span><span class=\"o\">=<\/span><span class=\"s1\">'-I\/usr\/local\/opt\/pcre\/include -I\/usr\/local\/opt\/openssl@1.1\/include'<\/span> <span class=\"nt\">--with-ld-opt<\/span><span class=\"o\">=<\/span><span class=\"s1\">'-L\/usr\/local\/opt\/pcre\/lib -L\/usr\/local\/opt\/openssl@1.1\/lib'<\/span> <span class=\"nt\">--conf-path<\/span><span class=\"o\">=<\/span>\/usr\/local\/etc\/nginx\/nginx.conf <span class=\"nt\">--pid-path<\/span><span class=\"o\">=<\/span>\/usr\/local\/var\/run\/nginx.pid <span class=\"nt\">--lock-path<\/span><span class=\"o\">=<\/span>\/usr\/local\/var\/run\/nginx.lock <span class=\"nt\">--http-client-body-temp-path<\/span><span class=\"o\">=<\/span>\/usr\/local\/var\/run\/nginx\/client_body_temp <span class=\"nt\">--http-proxy-temp-path<\/span><span class=\"o\">=<\/span>\/usr\/local\/var\/run\/nginx\/proxy_temp <span class=\"nt\">--http-fastcgi-temp-path<\/span><span class=\"o\">=<\/span>\/usr\/local\/var\/run\/nginx\/fastcgi_temp <span class=\"nt\">--http-uwsgi-temp-path<\/span><span class=\"o\">=<\/span>\/usr\/local\/var\/run\/nginx\/uwsgi_temp <span class=\"nt\">--http-scgi-temp-path<\/span><span class=\"o\">=<\/span>\/usr\/local\/var\/run\/nginx\/scgi_temp <span class=\"nt\">--http-log-path<\/span><span class=\"o\">=<\/span>\/usr\/local\/var\/log\/nginx\/access.log <span class=\"nt\">--error-log-path<\/span><span class=\"o\">=<\/span>\/usr\/local\/var\/log\/nginx\/error.log <span class=\"nt\">--with-compat<\/span> <span class=\"nt\">--with-debug<\/span> <span class=\"nt\">--with-http_addition_module<\/span> <span class=\"nt\">--with-http_auth_request_module<\/span> <span class=\"nt\">--with-http_dav_module<\/span> <span class=\"nt\">--with-http_degradation_module<\/span> <span class=\"nt\">--with-http_flv_module<\/span> <span class=\"nt\">--with-http_gunzip_module<\/span> <span class=\"nt\">--with-http_gzip_static_module<\/span> <span class=\"nt\">--with-http_mp4_module<\/span> <span class=\"nt\">--with-http_random_index_module<\/span> <span class=\"nt\">--with-http_realip_module<\/span> <span class=\"nt\">--with-http_secure_link_module<\/span> <span class=\"nt\">--with-http_slice_module<\/span> <span class=\"nt\">--with-http_ssl_module<\/span> <span class=\"nt\">--with-http_stub_status_module<\/span> <span class=\"nt\">--with-http_sub_module<\/span> <span class=\"nt\">--with-http_v2_module<\/span> <span class=\"nt\">--with-ipv6<\/span> <span class=\"nt\">--with-mail<\/span> <span class=\"nt\">--with-mail_ssl_module<\/span> <span class=\"nt\">--with-pcre<\/span> <span class=\"nt\">--with-pcre-jit<\/span> <span class=\"nt\">--with-stream<\/span> <span class=\"nt\">--with-stream_realip_module<\/span> <span class=\"nt\">--with-stream_ssl_module<\/span> <span class=\"nt\">--with-stream_ssl_preread_module<\/span>\r\n<\/code><\/pre>\n<p>\u914d\u7f6e\u53c2\u6570\uff1a\u590d\u5236\u7c98\u8d34\u540e\uff0c\u6267\u884c.\/configure\u547d\u4ee4\uff0c\u5c31\u51e0\u4e4e\u53ef\u4ee5\u786e\u5b9a\u5730\u7f16\u8bd1\u51fa\u4e0e\u4e4b\u76f8\u5339\u914d\u7684\u5916\u90e8\u6a21\u5757\u3002<\/p>\n<p>\u5982\u679c\u60f3\u5728Shell\u811a\u672c\u4e2d\u83b7\u53d6\u4fe1\u606f\uff0c\u53ef\u80fd\u4f1a\u53d8\u6210\u8fd9\u6837\u3002\u7531\u4e8enginx -V\u663e\u793a\u7684\u5185\u5bb9\u4e0d\u662f\u5728\u6807\u51c6\u8f93\u51fa\u800c\u662f\u5728\u6807\u51c6\u9519\u8bef\u8f93\u51fa\u4e2d\u8f93\u51fa\uff0c\u6240\u4ee5\u9700\u8981\u8003\u8651\u8fd9\u4e00\u70b9\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span>nginx <span class=\"nt\">-V<\/span> 2&gt;&amp;1 <span class=\"o\">&gt;<\/span> \/dev\/null | <span class=\"nb\">grep<\/span> <span class=\"nt\">-E<\/span> <span class=\"s2\">\"^configure \"<\/span> | <span class=\"nb\">sed<\/span> <span class=\"nt\">-E<\/span> <span class=\"s2\">\"s\/^.+: \/\/\"<\/span>\r\n<\/code><\/pre>\n<p>\u5982\u679c\u4f7f\u7528\u53d8\u91cf\uff0c\u5c31\u53ef\u4ee5\u8fd9\u6837\u505a\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ NGINX_OPTION<\/span><span class=\"o\">=<\/span><span class=\"si\">$(<\/span>nginx <span class=\"nt\">-V<\/span> 2&gt;&amp;1 <span class=\"o\">&gt;<\/span> \/dev\/null | <span class=\"nb\">grep<\/span> <span class=\"nt\">-E<\/span> <span class=\"s2\">\"^configure \"<\/span> | <span class=\"nb\">sed<\/span> <span class=\"nt\">-E<\/span> <span class=\"s2\">\"s\/^.+: \/\/\"<\/span><span class=\"si\">)<\/span>\r\n<span class=\"nv\">$ <\/span>.\/configure <span class=\"nt\">--add-dynamic-module<\/span><span class=\"o\">=<\/span>&lt;\u52d5\u7684\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30bd\u30fc\u30b9\u306e\u30d1\u30b9\u3092\u6307\u5b9a\u3057\u3066\u306d&gt; <span class=\"nv\">$NGINX_OPTION<\/span>\r\n<\/code><\/pre>\n<p>\u5b8c\u6210\u540e\uff0c\u60a8\u53ea\u9700\u6267\u884c\u4ee5\u4e0b\u64cd\u4f5c\u5373\u53ef\uff1a\u9996\u5148\uff0c\u521b\u5efa\u6a21\u5757\uff0c\u7136\u540e\u9002\u5f53\u5730\u914d\u7f6e\u6587\u4ef6\u5e76\u6dfb\u52a0\u5230nginx\u914d\u7f6e\u4e2d\u3002\u4e4b\u540e\uff0c\u901a\u8fc7\u8fd0\u884csudo nginx -t\u7b49\u547d\u4ee4\u8fdb\u884c\u8bed\u6cd5\u68c0\u67e5\uff0c\u518d\u901a\u8fc7sudo nginx -s reload\u7b49\u547d\u4ee4\u91cd\u65b0\u52a0\u8f7d\u6587\u4ef6\u4ee5\u5b8c\u7ed3\u3002<\/p>\n<div>\u5728\u8a2d\u7f6e\u8b80\u53d6\u6642\uff08\u4f8b\u5982 nginx -s reload\uff09\uff0c\u51fa\u73fe\u932f\u8aa4\u4e26\u7121\u6cd5\u555f\u52d5\u3002<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u603b\u7ed3 \u4ece1.9.11\u7248\u672c\u5f00\u59cb\uff0cNginx\u53ef\u4ee5\u4f7f\u7528\u52a8\u6001\u6a21\u5757\u3002\u7136\u800c\uff0c\u5b58\u5728\u4e00\u4e2a\u9650\u5236\u6761\u4ef6\u5373\u5916\u90e8\u6a21\u5757\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6\u5fc5\u987b\u4e0eN [&hellip;]<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-33392","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5173\u4e8e\u6bcf\u4e2a\u8f6f\u4ef6\u5305\u7684nginx\u7b7e\u540d - Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/\u5173\u4e8e\u6bcf\u4e2a\u8f6f\u4ef6\u5305\u7684nginx\u7b7e\u540d\u3002\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5173\u4e8e\u6bcf\u4e2a\u8f6f\u4ef6\u5305\u7684nginx\u7b7e\u540d\" \/>\n<meta property=\"og:description\" content=\"\u603b\u7ed3 \u4ece1.9.11\u7248\u672c\u5f00\u59cb\uff0cNginx\u53ef\u4ee5\u4f7f\u7528\u52a8\u6001\u6a21\u5757\u3002\u7136\u800c\uff0c\u5b58\u5728\u4e00\u4e2a\u9650\u5236\u6761\u4ef6\u5373\u5916\u90e8\u6a21\u5757\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6\u5fc5\u987b\u4e0eN [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u5173\u4e8e\u6bcf\u4e2a\u8f6f\u4ef6\u5305\u7684nginx\u7b7e\u540d\u3002\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2022-11-25T15:31:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-28T16:55:12+00:00\" \/>\n<meta name=\"author\" content=\"\u5b87, \u534e\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u5b87, \u534e\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%85%b3%e4%ba%8e%e6%af%8f%e4%b8%aa%e8%bd%af%e4%bb%b6%e5%8c%85%e7%9a%84nginx%e7%ad%be%e5%90%8d%e3%80%82\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%85%b3%e4%ba%8e%e6%af%8f%e4%b8%aa%e8%bd%af%e4%bb%b6%e5%8c%85%e7%9a%84nginx%e7%ad%be%e5%90%8d%e3%80%82\/\",\"name\":\"\u5173\u4e8e\u6bcf\u4e2a\u8f6f\u4ef6\u5305\u7684nginx\u7b7e\u540d - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2022-11-25T15:31:34+00:00\",\"dateModified\":\"2024-04-28T16:55:12+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%85%b3%e4%ba%8e%e6%af%8f%e4%b8%aa%e8%bd%af%e4%bb%b6%e5%8c%85%e7%9a%84nginx%e7%ad%be%e5%90%8d%e3%80%82\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%85%b3%e4%ba%8e%e6%af%8f%e4%b8%aa%e8%bd%af%e4%bb%b6%e5%8c%85%e7%9a%84nginx%e7%ad%be%e5%90%8d%e3%80%82\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%85%b3%e4%ba%8e%e6%af%8f%e4%b8%aa%e8%bd%af%e4%bb%b6%e5%8c%85%e7%9a%84nginx%e7%ad%be%e5%90%8d%e3%80%82\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5173\u4e8e\u6bcf\u4e2a\u8f6f\u4ef6\u5305\u7684nginx\u7b7e\u540d\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458\",\"name\":\"\u5b87, \u534e\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g\",\"caption\":\"\u5b87, \u534e\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yuhua\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%85%b3%e4%ba%8e%e6%af%8f%e4%b8%aa%e8%bd%af%e4%bb%b6%e5%8c%85%e7%9a%84nginx%e7%ad%be%e5%90%8d%e3%80%82\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u5173\u4e8e\u6bcf\u4e2a\u8f6f\u4ef6\u5305\u7684nginx\u7b7e\u540d - Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/\u5173\u4e8e\u6bcf\u4e2a\u8f6f\u4ef6\u5305\u7684nginx\u7b7e\u540d\u3002\/","og_locale":"zh_CN","og_type":"article","og_title":"\u5173\u4e8e\u6bcf\u4e2a\u8f6f\u4ef6\u5305\u7684nginx\u7b7e\u540d","og_description":"\u603b\u7ed3 \u4ece1.9.11\u7248\u672c\u5f00\u59cb\uff0cNginx\u53ef\u4ee5\u4f7f\u7528\u52a8\u6001\u6a21\u5757\u3002\u7136\u800c\uff0c\u5b58\u5728\u4e00\u4e2a\u9650\u5236\u6761\u4ef6\u5373\u5916\u90e8\u6a21\u5757\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6\u5fc5\u987b\u4e0eN [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u5173\u4e8e\u6bcf\u4e2a\u8f6f\u4ef6\u5305\u7684nginx\u7b7e\u540d\u3002\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2022-11-25T15:31:34+00:00","article_modified_time":"2024-04-28T16:55:12+00:00","author":"\u5b87, \u534e","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u5b87, \u534e","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%85%b3%e4%ba%8e%e6%af%8f%e4%b8%aa%e8%bd%af%e4%bb%b6%e5%8c%85%e7%9a%84nginx%e7%ad%be%e5%90%8d%e3%80%82\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%85%b3%e4%ba%8e%e6%af%8f%e4%b8%aa%e8%bd%af%e4%bb%b6%e5%8c%85%e7%9a%84nginx%e7%ad%be%e5%90%8d%e3%80%82\/","name":"\u5173\u4e8e\u6bcf\u4e2a\u8f6f\u4ef6\u5305\u7684nginx\u7b7e\u540d - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2022-11-25T15:31:34+00:00","dateModified":"2024-04-28T16:55:12+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%85%b3%e4%ba%8e%e6%af%8f%e4%b8%aa%e8%bd%af%e4%bb%b6%e5%8c%85%e7%9a%84nginx%e7%ad%be%e5%90%8d%e3%80%82\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e5%85%b3%e4%ba%8e%e6%af%8f%e4%b8%aa%e8%bd%af%e4%bb%b6%e5%8c%85%e7%9a%84nginx%e7%ad%be%e5%90%8d%e3%80%82\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%85%b3%e4%ba%8e%e6%af%8f%e4%b8%aa%e8%bd%af%e4%bb%b6%e5%8c%85%e7%9a%84nginx%e7%ad%be%e5%90%8d%e3%80%82\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u5173\u4e8e\u6bcf\u4e2a\u8f6f\u4ef6\u5305\u7684nginx\u7b7e\u540d"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458","name":"\u5b87, \u534e","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g","caption":"\u5b87, \u534e"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yuhua\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%85%b3%e4%ba%8e%e6%af%8f%e4%b8%aa%e8%bd%af%e4%bb%b6%e5%8c%85%e7%9a%84nginx%e7%ad%be%e5%90%8d%e3%80%82\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/33392","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=33392"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/33392\/revisions"}],"predecessor-version":[{"id":69837,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/33392\/revisions\/69837"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=33392"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=33392"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=33392"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}