{"id":755,"date":"2021-12-09T16:55:10","date_gmt":"2021-12-09T08:55:10","guid":{"rendered":"https:\/\/www.aiqinqin.info\/?p=755"},"modified":"2021-12-09T16:55:10","modified_gmt":"2021-12-09T08:55:10","slug":"centos7-%e9%85%8d%e7%bd%ae%e6%ad%a3%e5%90%91%e4%bb%a3%e7%90%86","status":"publish","type":"post","link":"https:\/\/www.aiqinqin.info\/?p=755","title":{"rendered":"centos7 \u914d\u7f6e\u6b63\u5411\u4ee3\u7406"},"content":{"rendered":"<blockquote><p>\n  \u8fd0\u884c\u4ee5\u4e0b\u811a\u672c\u5b89\u88c5nginx , \u8be5\u811a\u672c\u53ea\u9488\u5bf9nginx-1.20.1 \u7248\u672c\n<\/p><\/blockquote>\n<pre><code class=\"\">#!\/bin\/bash\n## install nginx\n\nWORK_DIR=`mktemp -d`\nyum install wget gcc gcc-c++ automake pcre pcre-devel zlib-devel openssl openssl-devel  git libxml2-devel libxslt-devel perl-devel perl-ExtUtils-Embed -y\ncd $WORK_DIR\ngit clone https:\/\/github.com\/chobits\/ngx_http_proxy_connect_module.git\nwget http:\/\/nginx.org\/download\/nginx-1.20.1.tar.gz\ntar zxvf nginx-1.20.1.tar.gz &amp;&amp; cd nginx-1.20.1\npatch -p1 &lt; $WORK_DIR\/ngx_http_proxy_connect_module\/patch\/proxy_connect_rewrite_1018.patch\n.\/configure --prefix=\/opt\/nginx --add-module=$WORK_DIR\/ngx_http_proxy_connect_module --user=apache --group=apache --with-http_ssl_module --with-http_stub_status_module --with-http_gzip_static_module --with-pcre --with-http_v2_module --with-http_dav_module --with-http_flv_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module --with-http_sub_module --with-http_random_index_module --with-http_degradation_module --with-http_secure_link_module --with-http_perl_module --with-debug --with-file-aio --with-stream --with-ld-opt=-Wl,-E\nmake &amp;&amp; make install\n\ncd  ~\n[ -d $WORK_DIR ] &amp;&amp; rm $WORK_DIR -rf\n\n## \u6dfb\u52a0nginx\u8fd0\u884c\u8d26\u6237\ngroupadd apache\nuseradd -g apache -s \/sbin\/nologin -c \"apache\" apache\n<\/code><\/pre>\n<blockquote><p>\n  \u4e0b\u9762\u662f\u4e00\u4e2a\u6b63\u5411\u4ee3\u7406\u7684\u914d\u7f6e\u6587\u4ef6\u793a\u4f8b:\n<\/p><\/blockquote>\n<pre><code class=\"\">server {\n     listen  0.0.0.0:10713;\n\n     access_log logs\/10713.access.log;\n     error_log logs\/10713.error.log;\n\n     resolver                       114.114.114.114  ipv6=off; # \u5173\u95edipv6 \u89e3\u51b3\u53ef\u80fd\u4f1a\u51fa\u73b0\u5931\u8d25\u7684\u95ee\u9898\n\n     proxy_connect;\n     proxy_connect_allow            all; # \u5141\u8bb8\u6240\u6709\u63a5\u53e3\u901a\u8fc7\u8be5\u7aef\u53e3\u8f6c\u53d1\n     proxy_connect_connect_timeout  100s;\n     proxy_connect_read_timeout     100s;\n     proxy_connect_send_timeout     100s;\n\n     # forward proxy for non-CONNECT request\n     location \/ {\n         proxy_pass http:\/\/$http_host;  # \u8fd9\u513f\u7684\u8bbe\u7f6e\u53ef\u4ee5\u89e3\u51b3\u4ee3\u7406\u975e\u5e38\u89c4\u7aef\u53e3\u7684\u95ee\u9898\n         proxy_set_header Host $host;\n     }\n }\n<\/code><\/pre>\n<blockquote><p>\n  \u53c2\u8003:  https:\/\/github.com\/chobits\/ngx_http_proxy_connect_module\n<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>\u8fd0\u884c\u4ee5\u4e0b\u811a\u672c\u5b89\u88c5nginx , \u8be5\u811a\u672c\u53ea\u9488\u5bf9nginx-1.20.1 \u7248\u672c #!\/bin\/bash ## in [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,3],"tags":[],"class_list":["post-755","post","type-post","status-publish","format-standard","hentry","category-centos","category-linux"],"_links":{"self":[{"href":"https:\/\/www.aiqinqin.info\/index.php?rest_route=\/wp\/v2\/posts\/755","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.aiqinqin.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.aiqinqin.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.aiqinqin.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.aiqinqin.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=755"}],"version-history":[{"count":1,"href":"https:\/\/www.aiqinqin.info\/index.php?rest_route=\/wp\/v2\/posts\/755\/revisions"}],"predecessor-version":[{"id":757,"href":"https:\/\/www.aiqinqin.info\/index.php?rest_route=\/wp\/v2\/posts\/755\/revisions\/757"}],"wp:attachment":[{"href":"https:\/\/www.aiqinqin.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=755"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.aiqinqin.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=755"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.aiqinqin.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=755"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}