{"id":26645,"date":"2025-04-19T16:21:16","date_gmt":"2025-04-19T08:21:16","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/26645.html"},"modified":"2025-04-19T16:21:16","modified_gmt":"2025-04-19T08:21:16","slug":"%e6%90%ad%e5%bb%banginx%e6%ad%a3%e5%90%91%e4%bb%a3%e7%90%86%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%8c%e8%bd%bb%e6%9d%be%e5%ae%9e%e7%8e%b0%e5%a4%96%e9%83%a8%e7%bd%91%e7%bb%9c%e8%af%b7%e6%b1%82%e7%9a%84","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/26645.html","title":{"rendered":"\u642d\u5efaNginx\u6b63\u5411\u4ee3\u7406\u670d\u52a1\u5668\uff0c\u8f7b\u677e\u5b9e\u73b0\u5916\u90e8\u7f51\u7edc\u8bf7\u6c42\u7684\u8f6c\u53d1"},"content":{"rendered":"<p>\u672c\u6587\u5c06\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528Nginx\u642d\u5efa\u4e00\u4e2a\u7b80\u5355\u7684\u6b63\u5411\u4ee3\u7406\u670d\u52a1\u5668&#xff0c;\u5b9e\u73b0\u5916\u90e8\u7f51\u7edc\u8bf7\u6c42\u7684\u8f6c\u53d1\u3002\u901a\u8fc7\u8bbe\u7f6e\u6b63\u5411\u4ee3\u7406&#xff0c;\u6211\u4eec\u53ef\u4ee5\u9690\u85cf\u771f\u5b9e\u7684\u670d\u52a1\u5668\u5730\u5740&#xff0c;\u63d0\u9ad8\u8bbf\u95ee\u901f\u5ea6&#xff0c;\u4ee5\u53ca\u589e\u5f3a\u7f51\u7edc\u5b89\u5168\u6027<\/p>\n<p>\u4e00\u3001Nginx\u6b63\u5411\u4ee3\u7406\u7b80\u4ecb<\/p>\n<p>\u6b63\u5411\u4ee3\u7406&#xff08;Forward Proxy&#xff09;\u662f\u4e00\u79cd\u7f51\u7edc\u670d\u52a1&#xff0c;\u5b83\u4f4d\u4e8e\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u4e4b\u95f4&#xff0c;\u5ba2\u6237\u7aef\u901a\u8fc7\u6b63\u5411\u4ee3\u7406\u5411\u670d\u52a1\u5668\u53d1\u9001\u8bf7\u6c42&#xff0c;\u670d\u52a1\u5668\u5c06\u8bf7\u6c42\u8f6c\u53d1\u7ed9\u76ee\u6807\u670d\u52a1\u5668&#xff0c;\u5e76\u5c06\u76ee\u6807\u670d\u52a1\u5668\u7684\u54cd\u5e94\u8fd4\u56de\u7ed9\u5ba2\u6237\u7aef\u3002\u6b63\u5411\u4ee3\u7406\u53ef\u4ee5\u9690\u85cf\u771f\u5b9e\u7684\u670d\u52a1\u5668\u5730\u5740&#xff0c;\u5b9e\u73b0\u5ba2\u6237\u7aef\u5bf9\u76ee\u6807\u670d\u52a1\u5668\u7684\u8bbf\u95ee\u3002<\/p>\n<p>\u7531\u4e8enginx\u6b63\u5411\u4ee3\u7406\u7684\u529f\u80fd\u6307\u4ee4\u8f83\u5c11&#xff0c;\u53ea\u9700\u8981\u8fdb\u884c\u7b80\u5355\u7684\u914d\u7f6e\u5373\u53ef<\/p>\n<p>server {<br \/>\n    resolver 114.114.114.114;       #\u6307\u5b9aDNS\u670d\u52a1\u5668IP\u5730\u5740<br \/>\n    listen 8080;<br \/>\n    location \/ {<br \/>\n        proxy_pass http:\/\/$http_host$request_uri;<br \/>\n    }<br \/>\n}  <\/p>\n<p>\u4ee5\u4e0a\u7684\u914d\u7f6e\u53ea\u80fd\u8bbf\u95ee80 \u7aef\u53e3\u7684\u7f51\u7ad9&#xff0c;\u800c\u4e0d\u80fd\u8bbf\u95eehttps443\u7aef\u53e3\u7684\u7f51\u7ad9&#xff0c;\u73b0\u5728\u7684\u7f51\u7ad9\u57fa\u672c\u4e0a\u90fd\u662fhttps\u7684\u8981\u89e3\u51b3\u6280\u80fd\u8bbf\u95eehttp80\u7aef\u53e3\u4e5f\u80fd\u8bbf\u95eehttps443\u7aef\u53e3\u7684\u7f51\u7ad9&#xff0c;\u9700\u8981\u7f6e\u4e24\u4e2aSERVER\u8282\u70b9&#xff0c;\u4e00\u4e2a\u5904\u7406HTTP\u8f6c\u53d1&#xff0c;\u53e6\u4e00\u4e2a\u5904\u7406HTTPS\u8f6c\u53d1&#xff0c;\u800c\u5ba2\u6237\u7aef\u90fd\u901a\u8fc7HTTP\u6765\u8bbf\u95ee\u4ee3\u7406&#xff0c;\u901a\u8fc7\u8bbf\u95ee\u4ee3\u7406\u4e0d\u540c\u7684\u7aef\u53e3&#xff0c;\u6765\u533a\u5206HTTP\u548cHTTPS\u8bf7\u6c42\u3002<\/p>\n<p>\u7531\u4e8e\u539f\u751f nginx \u53ea\u652f\u6301 http \u6b63\u5411\u4ee3\u7406&#xff0c;\u4e3a\u4e86 nginx \u652f\u6301 https \u6b63\u5411\u4ee3\u7406&#xff0c;\u53ef\u4ee5\u6253 ngx_http_proxy_connect_module \u8865\u4e01&#043; ssl \u6a21\u5757\u652f\u6301\u3002<\/p>\n<p>\u51c6\u5907\u73af\u5883&#xff1a;<\/p>\n<p>\u786e\u4fdd\u7cfb\u7edf\u4e2d\u5b89\u88c5\u4e86\u7f16\u8bd1\u6240\u9700\u7684\u5de5\u5177\u548c\u4f9d\u8d56&#xff0c;\u4f8b\u5982GCC\u3001make\u3001pcre-devel&#xff08; pere \u5e93 &#xff09;\u3001zlib-devel\u3001openssl-devel&#xff08;https&#xff09;\u7b49\u3002\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5&#xff1a;<\/p>\n<p>yum install gcc make pcre-devel zlib-devel openssl-devel<\/p>\n<p>1.2.1 \u4e0b\u8f7d\u5bf9\u5e94\u7248\u672c\u7684nginx&#xff08;\u6e90\u7801\u7f16\u8bd1&#xff09;<\/p>\n<p>wget https:\/\/nginx.org\/download\/nginx-1.20.2.tar.gz<br \/>\ntar -zxvf nginx-1.15.12.tar.gz -C \/usr\/local\/src<br \/>\ncd \/usr\/local\/src<br \/>\n[root&#064;web01 src] ls<br \/>\nnginx-1.20.2  <\/p>\n<p>\u5f53\u524d\u76ee\u5f55ngx_http_proxy_connect_module\u4e0b\u5305\u542b\u4e86\u4e00\u4e9b\u6587\u4ef6\u548c\u5b50\u76ee\u5f55&#xff0c;\u8fd9\u4e9b\u5185\u5bb9\u662f\u4e0eNginx\u7684ngx_http_proxy_connect_module\u7b2c\u4e09\u65b9\u6a21\u5757\u76f8\u5173\u7684\u3002\u8fd9\u4e2a\u6a21\u5757\u7528\u4e8e\u589e\u5f3aNginx&#xff0c;\u4f7f\u5176\u652f\u6301HTTP CONNECT\u65b9\u6cd5&#xff0c;\u4ece\u800c\u80fd\u591f\u4f5c\u4e3a\u6b63\u5411\u4ee3\u7406\u5904\u7406SSL\/TLS\u8fde\u63a5&#xff0c;\u5c24\u5176\u662f\u5bf9HTTPS\u6d41\u91cf\u7684\u4ee3\u7406\u3002 \u4e0b\u9762\u662f\u5217\u51fa\u7684\u5404\u6587\u4ef6\u548c\u76ee\u5f55\u7684\u7b80\u8981\u8bf4\u660e&#xff1a;<\/p>\n<p>config&#xff1a;\u8fd9\u662f\u914d\u7f6e\u6587\u4ef6&#xff0c;\u7528\u6765\u5b9a\u4e49\u7f16\u8bd1\u8be5\u6a21\u5757\u65f6\u7684\u4e00\u4e9b\u7279\u5b9a\u914d\u7f6e\u6216\u5b8f\u5b9a\u4e49\u3002 LICENSE&#xff1a;\u5305\u542b\u8be5\u6a21\u5757\u7684\u8bb8\u53ef\u534f\u8bae\u4fe1\u606f\u3002 ngx_http_proxy_connect_module.c&#xff1a;\u6838\u5fc3\u6e90\u4ee3\u7801\u6587\u4ef6&#xff0c;\u5b9e\u73b0\u4e86\u6a21\u5757\u7684\u529f\u80fd\u3002 patch&#xff1a;\u8fd9\u4e2a\u5b50\u76ee\u5f55\u5185\u5305\u542b\u4e86\u7528\u4e8e\u5c06\u8be5\u6a21\u5757\u96c6\u6210\u5230Nginx\u6e90\u4ee3\u7801\u7684\u8865\u4e01\u6587\u4ef6&#xff0c; README.md&#xff1a;\u81ea\u8ff0\u6587\u4ef6&#xff0c;\u901a\u5e38\u4f1a\u5305\u542b\u6a21\u5757\u7684\u7b80\u4ecb\u3001\u5b89\u88c5\u6307\u5357\u3001\u914d\u7f6e\u793a\u4f8b\u7b49\u91cd\u8981\u4fe1\u606f\u3002 t&#xff1a;\u8fd9\u4e2a\u5b50\u76ee\u5f55\u53ef\u80fd\u5305\u542b\u4e00\u4e9b\u6d4b\u8bd5\u811a\u672c\u6216\u793a\u4f8b&#xff0c;\u7528\u4e8e\u9a8c\u8bc1\u6a21\u5757\u529f\u80fd\u662f\u5426\u6b63\u5e38\u5de5\u4f5c\u3002 \u5982\u679c\u6253\u7b97\u7f16\u8bd1\u5e76\u5b89\u88c5\u8fd9\u4e2a\u6a21\u5757\u5230Nginx&#xff0c;\u4e00\u822c\u6d41\u7a0b\u5305\u62ec&#xff1a; \u9605\u8bfbREADME.md&#xff1a;\u4e86\u89e3\u8be6\u7ec6\u7684\u5b89\u88c5\u6b65\u9aa4\u3001\u4f9d\u8d56\u5173\u7cfb\u4ee5\u53ca\u4efb\u4f55\u7279\u6b8a\u7684\u914d\u7f6e\u8981\u6c42\u3002 \u5e94\u7528\u8865\u4e01&#xff1a;\u6839\u636eREADME.md\u7684\u6307\u5bfc&#xff0c;\u9009\u62e9\u5408\u9002\u7684\u8865\u4e01\u6587\u4ef6&#xff0c;\u5e76\u5e94\u7528\u5230Nginx\u6e90\u4ee3\u7801\u4e2d\u3002 \u914d\u7f6eNginx&#xff1a;\u5728Nginx\u7684.\/configure\u547d\u4ee4\u4e2d\u786e\u4fdd\u6307\u5b9a\u4e86\u8be5\u6a21\u5757&#xff0c;\u4f8b\u5982&#xff0c;\u5982\u679c\u6a21\u5757\u7684\u914d\u7f6e\u6587\u4ef6\u6216\u8bf4\u660e\u4e2d\u6709\u7279\u5b9a\u7684\u2013add-module\u53c2\u6570&#xff0c;\u9700\u8981\u5728\u914d\u7f6e\u65f6\u52a0\u5165\u3002 \u7f16\u8bd1\u5e76\u5b89\u88c5Nginx&#xff1a;\u6267\u884cmake\u548cmake install\u547d\u4ee4\u5b8c\u6210\u7f16\u8bd1\u548c\u5b89\u88c5\u3002 \u914d\u7f6eNginx\u914d\u7f6e\u6587\u4ef6&#xff1a;\u5728Nginx\u7684\u914d\u7f6e\u6587\u4ef6&#xff08;\u5982nginx.conf&#xff09;\u4e2d&#xff0c;\u6839\u636e\u6a21\u5757\u7684\u6587\u6863\u6dfb\u52a0\u76f8\u5e94\u7684\u914d\u7f6e\u6307\u4ee4\u4ee5\u542f\u7528\u548c\u914d\u7f6eHTTP CONNECT\u4ee3\u7406\u529f\u80fd\u3002<\/p>\n<p>[root&#064;web01 src] yum install git<br \/>\n[root&#064;web01 src] git clone https:\/\/github.com\/chobits\/ngx_http_proxy_connect_module<br \/>\n[root&#064;web01 src] cd nginx-1.20.2<br \/>\n[root&#064;web01 nginx-1.20.2] ls<br \/>\nauto  CHANGES  CHANGES.ru  conf  configure  contrib  html  LICENSE  Makefile  man  ngx_http_proxy_connect_module  objs  README  src<\/p>\n<p>1.2.3 \u4f7f\u7528https\u4ee3\u7406\u6a21\u5757\u5bf9\u6e90\u4ee3\u7801\u4fee\u6539&#xff0c;\u9009\u62e9\u589e\u52a0\u6a21\u5757\u9700\u8981\u6253\u8865\u4e01\u7684\u7248\u672c ![\u5728<img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419082114-68035cfad6848.png\" alt=\"\u8bf7\u6dfb\u52a0\u56fe\u7247\u63cf\u8ff0\" \/> \u5bf9 nginx \u6e90\u7801\u4fee\u6539&#xff0c;\u8fd9\u4e00\u6b65\u5f88\u91cd\u8981&#xff0c;\u4e0d\u7136\u540e\u9762\u7684 make \u8fc7\u4e0d\u53bb<\/p>\n<p>[root&#064;web01 patch] patch -d \/usr\/local\/src\/nginx-1.20.2 -p 1 &lt; \/usr\/local\/src\/ngx_http_proxy_connect_module\/patch\/proxy_connect_rewrite_1018.patch<br \/>\npatching file src\/http\/ngx_http_core_module.c<br \/>\npatching file src\/http\/ngx_http_parse.c<br \/>\npatching file src\/http\/ngx_http_request.c<br \/>\npatching file src\/http\/ngx_http_request.h<br \/>\npatching file src\/http\/ngx_http_variables.c<\/p>\n<p>1.2.4 \u6e90\u7801\u5b89\u88c5 \u6307\u5b9a\u5b89\u88c5\u7684\u8def\u5f84\u548c\u5173\u8054\u7684\u6a21\u5757\u5e76\u4e14\u589e\u52a0\u6240\u9700\u7684\u6a21\u5757<\/p>\n<p>[root&#064;web01 nginx-1.20.2] .\/configure &#8211;prefix&#061;\/usr\/local\/nginx <\/p>\n<p>\u2013with-http_stub_status_module \u2013with-http_ssl_module \u2013with-file-aio &#8211;with-http_realip_module \u2013add-module&#061;\/usr\/local\/src\/ngx_http_proxy_connect_module\/ [root&#064;web01 nginx-1.20.2] make [root&#064;web01 nginx-1.20.2] make install<\/p>\n<p>\u67e5\u770b\u5b89\u88c5\u60c5\u51b5&#xff1a;<\/p>\n<p>[root&#064;web01 ~] tree \/usr\/local\/nginx\/<br \/>\n\/usr\/local\/nginx\/<br \/>\n\u251c\u2500\u2500 conf<br \/>\n\u2502   \u251c\u2500\u2500 fastcgi.conf<br \/>\n\u2502   \u251c\u2500\u2500 fastcgi.conf.default<br \/>\n\u2502   \u251c\u2500\u2500 fastcgi_params<br \/>\n\u2502   \u251c\u2500\u2500 fastcgi_params.default<br \/>\n\u2502   \u251c\u2500\u2500 koi-utf<br \/>\n\u2502   \u251c\u2500\u2500 koi-win<br \/>\n\u2502   \u251c\u2500\u2500 mime.types<br \/>\n\u2502   \u251c\u2500\u2500 mime.types.default<br \/>\n\u2502   \u251c\u2500\u2500 nginx.conf       # nginx\u4e3b\u914d\u7f6e\u6587\u4ef6<br \/>\n\u2502   \u251c\u2500\u2500 nginx.conf.default<br \/>\n\u2502   \u251c\u2500\u2500 scgi_params<br \/>\n\u2502   \u251c\u2500\u2500 scgi_params.default<br \/>\n\u2502   \u251c\u2500\u2500 uwsgi_params<br \/>\n\u2502   \u251c\u2500\u2500 uwsgi_params.default<br \/>\n\u2502   \u2514\u2500\u2500 win-utf<br \/>\n\u251c\u2500\u2500 html<br \/>\n\u2502   \u251c\u2500\u2500 50x.html<br \/>\n\u2502   \u2514\u2500\u2500 index.html<br \/>\n\u251c\u2500\u2500 logs<br \/>\n\u2514\u2500\u2500 sbin<br \/>\n    \u2514\u2500\u2500 nginx    #  Nginx \u7684\u4e8c\u8fdb\u5236\u53ef\u6267\u884c\u6587\u4ef6&#xff0c;\u8fd9\u662f\u901a\u8fc7\u6e90\u7801\u7f16\u8bd1\u5f97\u5230\u7684 nginx \u53ef\u6267\u884c\u7a0b\u5e8f&#xff0c;\u53ef\u4ee5\u76f4\u63a5\u5728\u8fd9\u4e2a\u76ee\u5f55\u4e0b\u901a\u8fc7 .\/nginx \u547d\u4ee4\u542f\u52a8 Nginx \u670d\u52a1\u5668<\/p>\n<p>\u67e5\u770b\u7248\u672c\u4fe1\u606f&#xff1a;<\/p>\n<p>[root&#064;web01 ~] \/usr\/local\/nginx\/sbin\/nginx -V<br \/>\nnginx version: nginx\/1.20.2<br \/>\nbuilt by gcc 11.4.1 20231218 (Red Hat 11.4.1-3) (GCC)<br \/>\nbuilt with OpenSSL 3.0.7 1 Nov 2022<br \/>\nTLS SNI support enabled<br \/>\nconfigure arguments: &#8211;prefix&#061;\/usr\/local\/nginx &#8211;with-http_stub_status_module<br \/>\n&#8211;with-http_ssl_module &#8211;with-file-aio<br \/>\n&#8211;with-http_realip_module &#8211;add-module&#061;\/usr\/local\/src\/ngx_http_proxy_connect_module\/<\/p>\n<p>\u4fee\u6539nginx\u7684\u4e3b\u914d\u7f6e\u6587\u4ef6<\/p>\n<p>[root&#064;web01 ~] vim \/usr\/local\/nginx\/conf\/nginx.conf<\/p>\n<p> server {<br \/>\n        listen 8787;<br \/>\n        resolver  223.5.5.5 114.114.114.114 valid&#061;300s;<br \/>\n        resolver_timeout 10s;<br \/>\n        proxy_connect;<br \/>\n        proxy_connect_allow 443 80;<br \/>\n        proxy_connect_connect_timeout 10s;<br \/>\n        proxy_connect_read_timeout 10s;<br \/>\n        proxy_connect_send_timeout 10s;<\/p>\n<p>        location \/ {<br \/>\n                proxy_set_header Host $host;<br \/>\n                proxy_pass $scheme:\/\/$http_host$request_uri;<br \/>\n                proxy_buffers 256 4k;<br \/>\n                proxy_max_temp_file_size 0k;<br \/>\n                proxy_connect_timeout 30;<br \/>\n                proxy_send_timeout 60;<br \/>\n                proxy_read_timeout 60;<br \/>\n                proxy_next_upstream error timeout invalid_header http_502;<br \/>\n        }<br \/>\n    }<\/p>\n<p>   listen 8787; \u8868\u793a\u670d\u52a1\u5668\u76d1\u542c8787\u7aef\u53e3\u63a5\u6536\u8bf7\u6c42\u3002 resolver 8.8.8.8;<br \/>\n   \u914d\u7f6eDNS\u89e3\u6790\u5668&#xff0c;\u4f7f\u7528Google\u7684\u516c\u5171DNS\u670d\u52a1\u5668\u8fdb\u884c\u57df\u540d\u89e3\u6790\u3002 proxy_connect;<br \/>\n   \u5f00\u542f\u4ee3\u7406\u8fde\u63a5\u6a21\u5757&#xff0c;\u901a\u5e38\u7528\u4e8e\u5904\u7406HTTPS\u4ee3\u7406\u3002 proxy_connect_allow 443 563;<br \/>\n   \u5141\u8bb8\u4ee3\u7406\u8fde\u63a5\u5230443&#xff08;HTTPS\u6807\u51c6\u7aef\u53e3&#xff09;\u548c563&#xff08;\u901a\u5e38\u7528\u4e8e\u67d0\u4e9b\u52a0\u5bc6\u7684\u5b9e\u65f6\u901a\u4fe1\u534f\u8bae&#xff09;\u7aef\u53e3<br \/>\n   proxy_connect_connect_timeout 10s;, proxy_connect_read_timeout 10s<br \/>\n   proxy_connect_send_timeout 10s; \u5206\u522b\u8bbe\u7f6e\u4e86HTTPS\u4ee3\u7406\u8fde\u63a5\u7684\u5efa\u7acb\u3001\u8bfb\u53d6\u548c\u53d1\u9001\u8d85\u65f6\u65f6\u95f4&#xff0c;\u5747\u4e3a10\u79d2<br \/>\n   location \/ { &#8230; } \u5339\u914d\u6240\u6709\u8bf7\u6c42&#xff0c;\u5e76\u4f7f\u7528proxy_pass\u6307\u4ee4\u5c06\u8bf7\u6c42\u4ee3\u7406\u5230\u76f8\u540c\u65b9\u6848&#xff08;HTTP\u6216HTTPS&#xff09;\u3001\u76f8\u540c\u4e3b\u673a\u548c\u76f8\u540cURI\u7684\u5730\u5740<\/p>\n<p>\u8bf7\u6ce8\u610f&#xff0c;proxy_pass\u8bed\u53e5\u4e2d\u4f7f\u7528\u7684\u53d8\u91cf$scheme, $http_host\u548c$request_uri\u662f\u4ece\u8bf7\u6c42\u4e2d\u6355\u83b7\u7684&#xff0c;\u8fd9\u6837\u53ef\u4ee5\u4fdd\u6301\u539f\u59cb\u8bf7\u6c42\u7684\u5b8c\u6574\u6027&#xff0c;\u5f53\u8f6c\u53d1\u8bf7\u6c42\u5230\u540e\u7aef\u65f6&#xff0c;\u8fd9\u4e9b\u53d8\u91cf\u5c06\u88ab\u66ff\u6362\u4e3a\u5b9e\u9645\u7684\u8bf7\u6c42\u503c\u3002<\/p>\n<p>[root&#064;web01 ~] nginx -t<br \/>\nnginx: the configuration file \/usr\/local\/nginx\/conf\/nginx.conf syntax is ok<br \/>\nnginx: configuration file \/usr\/local\/nginx\/conf\/nginx.conf test is successful<\/p>\n<p>\u542f\u52a8\u547d\u4ee4<\/p>\n<p>nginx -c \/usr\/local\/nginx\/conf\/nginx.conf<br \/>\nor<br \/>\nsystemctl start nginx<br \/>\nor<br \/>\nnginx -s reload<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.2k\u6b21\uff0c\u70b9\u8d5e12\u6b21\uff0c\u6536\u85cf11\u6b21\u3002\u4ee5\u4e0a\u7684\u914d\u7f6e\u53ea\u80fd\u8bbf\u95ee80 \u7aef\u53e3\u7684\u7f51\u7ad9\uff0c\u800c\u4e0d\u80fd\u8bbf\u95eehttps443\u7aef\u53e3\u7684\u7f51\u7ad9\uff0c\u73b0\u5728\u7684\u7f51\u7ad9\u57fa\u672c\u4e0a\u90fd\u662fhttps\u7684\u8981\u89e3\u51b3\u6280\u80fd\u8bbf\u95eehttp80\u7aef\u53e3\u4e5f\u80fd\u8bbf\u95eehttps443\u7aef\u53e3\u7684\u7f51\u7ad9\uff0c\u9700\u8981\u7f6e\u4e24\u4e2aSERVER\u8282\u70b9\uff0c\u4e00\u4e2a\u5904\u7406HTTP\u8f6c\u53d1\uff0c\u53e6\u4e00\u4e2a\u5904\u7406HTTPS\u8f6c\u53d1\uff0c\u800c\u5ba2\u6237\u7aef\u90fd\u901a\u8fc7HTTP\u6765\u8bbf\u95ee\u4ee3\u7406\uff0c\u901a\u8fc7\u8bbf\u95ee\u4ee3\u7406\u4e0d\u540c\u7684\u7aef\u53e3\uff0c\u6765\u533a\u5206HTTP\u548cHTTPS\u8bf7\u6c42\u3002\u8fd9\u4e2a\u6a21\u5757\u7528\u4e8e\u589e\u5f3aNginx\uff0c\u4f7f\u5176\u652f\u6301HTTP CONNECT\u65b9\u6cd5\uff0c\u4ece\u800c\u80fd\u591f\u4f5c\u4e3a\u6b63\u5411\u4ee3\u7406\u5904\u7406SSL\/TLS\u8fde\u63a5\uff0c\u5c24\u5176\u662f\u5bf9HTTPS\u6d41\u91cf\u7684\u4ee3\u7406\u3002\u4fee\u6539nginx\u7684\u4e3b\u914d\u7f6e\u6587\u4ef6\u3002_nginx\u4ee3\u7406\u8f6c\u53d1<\/p>\n","protected":false},"author":2,"featured_media":26644,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[117,78,44],"topic":[],"class_list":["post-26645","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-nginx","tag-78","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u642d\u5efaNginx\u6b63\u5411\u4ee3\u7406\u670d\u52a1\u5668\uff0c\u8f7b\u677e\u5b9e\u73b0\u5916\u90e8\u7f51\u7edc\u8bf7\u6c42\u7684\u8f6c\u53d1 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/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.wsisp.com\/helps\/26645.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u642d\u5efaNginx\u6b63\u5411\u4ee3\u7406\u670d\u52a1\u5668\uff0c\u8f7b\u677e\u5b9e\u73b0\u5916\u90e8\u7f51\u7edc\u8bf7\u6c42\u7684\u8f6c\u53d1 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.2k\u6b21\uff0c\u70b9\u8d5e12\u6b21\uff0c\u6536\u85cf11\u6b21\u3002\u4ee5\u4e0a\u7684\u914d\u7f6e\u53ea\u80fd\u8bbf\u95ee80 \u7aef\u53e3\u7684\u7f51\u7ad9\uff0c\u800c\u4e0d\u80fd\u8bbf\u95eehttps443\u7aef\u53e3\u7684\u7f51\u7ad9\uff0c\u73b0\u5728\u7684\u7f51\u7ad9\u57fa\u672c\u4e0a\u90fd\u662fhttps\u7684\u8981\u89e3\u51b3\u6280\u80fd\u8bbf\u95eehttp80\u7aef\u53e3\u4e5f\u80fd\u8bbf\u95eehttps443\u7aef\u53e3\u7684\u7f51\u7ad9\uff0c\u9700\u8981\u7f6e\u4e24\u4e2aSERVER\u8282\u70b9\uff0c\u4e00\u4e2a\u5904\u7406HTTP\u8f6c\u53d1\uff0c\u53e6\u4e00\u4e2a\u5904\u7406HTTPS\u8f6c\u53d1\uff0c\u800c\u5ba2\u6237\u7aef\u90fd\u901a\u8fc7HTTP\u6765\u8bbf\u95ee\u4ee3\u7406\uff0c\u901a\u8fc7\u8bbf\u95ee\u4ee3\u7406\u4e0d\u540c\u7684\u7aef\u53e3\uff0c\u6765\u533a\u5206HTTP\u548cHTTPS\u8bf7\u6c42\u3002\u8fd9\u4e2a\u6a21\u5757\u7528\u4e8e\u589e\u5f3aNginx\uff0c\u4f7f\u5176\u652f\u6301HTTP CONNECT\u65b9\u6cd5\uff0c\u4ece\u800c\u80fd\u591f\u4f5c\u4e3a\u6b63\u5411\u4ee3\u7406\u5904\u7406SSL\/TLS\u8fde\u63a5\uff0c\u5c24\u5176\u662f\u5bf9HTTPS\u6d41\u91cf\u7684\u4ee3\u7406\u3002\u4fee\u6539nginx\u7684\u4e3b\u914d\u7f6e\u6587\u4ef6\u3002_nginx\u4ee3\u7406\u8f6c\u53d1\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/26645.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-19T08:21:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419082114-68035cfad6848.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/26645.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/26645.html\",\"name\":\"\u642d\u5efaNginx\u6b63\u5411\u4ee3\u7406\u670d\u52a1\u5668\uff0c\u8f7b\u677e\u5b9e\u73b0\u5916\u90e8\u7f51\u7edc\u8bf7\u6c42\u7684\u8f6c\u53d1 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-19T08:21:16+00:00\",\"dateModified\":\"2025-04-19T08:21:16+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/26645.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/26645.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/26645.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u642d\u5efaNginx\u6b63\u5411\u4ee3\u7406\u670d\u52a1\u5668\uff0c\u8f7b\u677e\u5b9e\u73b0\u5916\u90e8\u7f51\u7edc\u8bf7\u6c42\u7684\u8f6c\u53d1\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u642d\u5efaNginx\u6b63\u5411\u4ee3\u7406\u670d\u52a1\u5668\uff0c\u8f7b\u677e\u5b9e\u73b0\u5916\u90e8\u7f51\u7edc\u8bf7\u6c42\u7684\u8f6c\u53d1 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","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.wsisp.com\/helps\/26645.html","og_locale":"zh_CN","og_type":"article","og_title":"\u642d\u5efaNginx\u6b63\u5411\u4ee3\u7406\u670d\u52a1\u5668\uff0c\u8f7b\u677e\u5b9e\u73b0\u5916\u90e8\u7f51\u7edc\u8bf7\u6c42\u7684\u8f6c\u53d1 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.2k\u6b21\uff0c\u70b9\u8d5e12\u6b21\uff0c\u6536\u85cf11\u6b21\u3002\u4ee5\u4e0a\u7684\u914d\u7f6e\u53ea\u80fd\u8bbf\u95ee80 \u7aef\u53e3\u7684\u7f51\u7ad9\uff0c\u800c\u4e0d\u80fd\u8bbf\u95eehttps443\u7aef\u53e3\u7684\u7f51\u7ad9\uff0c\u73b0\u5728\u7684\u7f51\u7ad9\u57fa\u672c\u4e0a\u90fd\u662fhttps\u7684\u8981\u89e3\u51b3\u6280\u80fd\u8bbf\u95eehttp80\u7aef\u53e3\u4e5f\u80fd\u8bbf\u95eehttps443\u7aef\u53e3\u7684\u7f51\u7ad9\uff0c\u9700\u8981\u7f6e\u4e24\u4e2aSERVER\u8282\u70b9\uff0c\u4e00\u4e2a\u5904\u7406HTTP\u8f6c\u53d1\uff0c\u53e6\u4e00\u4e2a\u5904\u7406HTTPS\u8f6c\u53d1\uff0c\u800c\u5ba2\u6237\u7aef\u90fd\u901a\u8fc7HTTP\u6765\u8bbf\u95ee\u4ee3\u7406\uff0c\u901a\u8fc7\u8bbf\u95ee\u4ee3\u7406\u4e0d\u540c\u7684\u7aef\u53e3\uff0c\u6765\u533a\u5206HTTP\u548cHTTPS\u8bf7\u6c42\u3002\u8fd9\u4e2a\u6a21\u5757\u7528\u4e8e\u589e\u5f3aNginx\uff0c\u4f7f\u5176\u652f\u6301HTTP CONNECT\u65b9\u6cd5\uff0c\u4ece\u800c\u80fd\u591f\u4f5c\u4e3a\u6b63\u5411\u4ee3\u7406\u5904\u7406SSL\/TLS\u8fde\u63a5\uff0c\u5c24\u5176\u662f\u5bf9HTTPS\u6d41\u91cf\u7684\u4ee3\u7406\u3002\u4fee\u6539nginx\u7684\u4e3b\u914d\u7f6e\u6587\u4ef6\u3002_nginx\u4ee3\u7406\u8f6c\u53d1","og_url":"https:\/\/www.wsisp.com\/helps\/26645.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-19T08:21:16+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419082114-68035cfad6848.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/26645.html","url":"https:\/\/www.wsisp.com\/helps\/26645.html","name":"\u642d\u5efaNginx\u6b63\u5411\u4ee3\u7406\u670d\u52a1\u5668\uff0c\u8f7b\u677e\u5b9e\u73b0\u5916\u90e8\u7f51\u7edc\u8bf7\u6c42\u7684\u8f6c\u53d1 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-19T08:21:16+00:00","dateModified":"2025-04-19T08:21:16+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/26645.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/26645.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/26645.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u642d\u5efaNginx\u6b63\u5411\u4ee3\u7406\u670d\u52a1\u5668\uff0c\u8f7b\u677e\u5b9e\u73b0\u5916\u90e8\u7f51\u7edc\u8bf7\u6c42\u7684\u8f6c\u53d1"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/26645","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=26645"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/26645\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/26644"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=26645"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=26645"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=26645"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=26645"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}