{"id":122283,"date":"2026-11-04T15:24:46","date_gmt":"2026-11-04T07:24:46","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/122283.html"},"modified":"2026-11-04T15:24:46","modified_gmt":"2026-11-04T07:24:46","slug":"%e7%ac%ac12%e7%ab%a0%ef%bc%9anginx-ssl-tls-%e9%85%8d%e7%bd%ae%e4%b8%8e-https-%e5%ae%9e%e6%88%98","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/122283.html","title":{"rendered":"\u7b2c12\u7ae0\uff1aNginx SSL\/TLS \u914d\u7f6e\u4e0e HTTPS \u5b9e\u6218"},"content":{"rendered":"<p>        \/* MD \/ \u5bcc\u6587\u672c\u4e2d\u7684 .toc\uff08\u542b\u535a\u5ba2\u56ed\u642c\u5bb6\u7b49\u5d4c\u5957\u7ed3\u6784\uff09\uff1b.toc-box \u5728\u4fa7\u680f\uff0c\u4e0d\u53d7\u5f71\u54cd *\/<br \/>\n        #content_views .toc,<br \/>\n        \/* \u7f16\u8f91\u5668\u5e38\u5728\u76ee\u5f55\u524d\u540e\u63d2\u5165\u7a7a p\uff08:empty \u4ecd\u5360 20px\uff09\uff0c\u4e00\u5e76\u53bb\u6389\u907f\u514d\u9876\u7a7a\u9699 *\/<br \/>\n        #content_views.markdown_views &gt; p:empty:has(+ .toc),<br \/>\n        #content_views.markdown_views &gt; .toc + p:empty,<br \/>\n        \/* \u5bcc\u6587\u672c\u65e7\u7248\u76ee\u5f55\u6807\u8bb0 *\/<br \/>\n        #content_views.htmledit_views #main-toc,<br \/>\n        #content_views.htmledit_views #hr-toc,<br \/>\n        #content_views.htmledit_views p[id*=\\&#8221;-toc\\&#8221;] {<br \/>\n          display: none !important;<br \/>\n        }<br \/>\n        \/* \u76ee\u5f55\u53bb\u6389\u540e\uff0c\u7d27\u8ddf\u7684\u9996\u4e2a\u6807\u9898\u4e0d\u518d\u591a\u51fa\u4e00\u5757\u4e0a\u8fb9\u8ddd *\/<br \/>\n        #content_views.markdown_views &gt; .toc + h1,<br \/>\n        #content_views.markdown_views &gt; .toc + h2,<br \/>\n        #content_views.markdown_views &gt; .toc + h3,<br \/>\n        #content_views.markdown_views &gt; .toc + h4,<br \/>\n        #content_views.markdown_views &gt; .toc + p:empty + h1,<br \/>\n        #content_views.markdown_views &gt; .toc + p:empty + h2,<br \/>\n        #content_views.markdown_views &gt; .toc + p:empty + h3,<br \/>\n        #content_views.markdown_views &gt; .toc + p:empty + h4 {<br \/>\n          margin-top: 0 !important;<br \/>\n        }<\/p>\n<h3>1. \u9879\u76ee\u80cc\u666f<\/h3>\n<p>&#034;\u9c9c\u679c\u56ed&#034;\u7684\u7ebf\u4e0a\u4e1a\u52a1\u5728\u8fc7\u53bb\u4e24\u5e74\u4e2d\u98de\u901f\u53d1\u5c55&#xff0c;\u4f46\u540c\u65f6\u4e5f\u6210\u4e3a\u4e86\u7f51\u7edc\u653b\u51fb\u7684\u9ad8\u9891\u76ee\u6807\u3002\u4e0a\u4e2a\u6708\u7684\u4fc3\u9500\u6d3b\u52a8\u4e2d&#xff0c;\u5b89\u5168\u56e2\u961f\u76d1\u6d4b\u5230\u591a\u8d77\u4e2d\u95f4\u4eba\u653b\u51fb&#xff08;MITM&#xff09;\u5c1d\u8bd5&#xff1a;\u653b\u51fb\u8005\u5728\u516c\u5171WiFi\u73af\u5883\u4e0b\u52ab\u6301\u7528\u6237\u4f1a\u8bdd&#xff0c;\u7be1\u6539\u8ba2\u5355\u91d1\u989d\u548c\u6536\u8d27\u5730\u5740\u3002\u867d\u7136\u98ce\u63a7\u7cfb\u7edf\u53ca\u65f6\u62e6\u622a\u4e86\u5927\u90e8\u5206\u5f02\u5e38\u4ea4\u6613&#xff0c;\u4f46\u8fd9\u4e00\u4e8b\u4ef6\u8ba9\u7ba1\u7406\u5c42\u610f\u8bc6\u5230\u2014\u2014\u5168\u7ad9HTTPS\u5347\u7ea7\u5df2\u7ecf\u523b\u4e0d\u5bb9\u7f13\u3002<\/p>\n<p>\u6b64\u5916&#xff0c;\u968f\u7740iOS\u548cAndroid\u7cfb\u7edf\u5bf9\u975eHTTPS\u6d41\u91cf\u7684\u9650\u5236\u8d8a\u6765\u8d8a\u4e25\u683c&#xff08;\u5982iOS\u7684ATS\u7b56\u7565\u8981\u6c42\u6240\u6709\u7f51\u7edc\u8bf7\u6c42\u5fc5\u987b\u4f7f\u7528TLS 1.2\u4ee5\u4e0a\u7248\u672c&#xff09;&#xff0c;\u9c9c\u679c\u56ed\u7684\u6df7\u5408\u5185\u5bb9&#xff08;Mixed Content&#xff09;\u95ee\u9898\u4e5f\u5f00\u59cb\u66b4\u9732&#xff1a;\u4e3b\u7ad9\u867d\u7136\u542f\u7528\u4e86HTTPS&#xff0c;\u4f46\u90e8\u5206\u9759\u6001\u8d44\u6e90\u4ecd\u901a\u8fc7HTTP\u52a0\u8f7d&#xff0c;\u5bfc\u81f4\u6d4f\u89c8\u5668\u5b89\u5168\u9501\u6807\u5fd7\u5f02\u5e38&#xff0c;\u7528\u6237\u4fe1\u4efb\u5ea6\u4e0b\u964d\u3002<\/p>\n<p>\u8fd0\u7ef4\u56e2\u961f\u8d1f\u8d23\u4eba\u628aHTTPS\u5168\u9762\u8fc1\u79fb\u7684\u4efb\u52a1\u4ea4\u7ed9\u4e86\u5c0f\u80d6\u3002\u5c0f\u80d6\u7b2c\u4e00\u6b21\u63a5\u89e6SSL\u8bc1\u4e66&#xff0c;\u5728\u4e91\u5e73\u53f0\u8d2d\u4e70\u4e86\u4e00\u5f20\u5355\u57df\u540d\u8bc1\u4e66\u540e&#xff0c;\u7167\u7740\u7f51\u4e0a\u7684\u6559\u7a0b\u5728Nginx\u91cc\u914d\u4e86ssl_certificate\u548cssl_certificate_key&#xff0c;\u7136\u540e\u5ba3\u5e03&#034;\u641e\u5b9a&#034;\u3002\u4f46\u5c0f\u767d\u5728\u626b\u63cf\u6d4b\u8bd5\u65f6\u53d1\u73b0\u4e86\u4e0d\u5c11\u95ee\u9898&#xff1a;\u670d\u52a1\u5668\u4ecd\u652f\u6301\u5df2\u7206\u6f0f\u6d1e\u7684SSLv3\u534f\u8bae\u3001\u8bc1\u4e66\u94fe\u4e0d\u5b8c\u6574\u5bfc\u81f4\u90e8\u5206\u6d4f\u89c8\u5668\u8b66\u544a\u3001\u6ca1\u6709\u5f00\u542fOCSP Stapling\u5bfc\u81f4\u9996\u6b21\u8fde\u63a5\u63e1\u624b\u8017\u65f6\u957f\u8fbe400\u6beb\u79d2\u3001HTTP\/2\u4e5f\u672a\u542f\u7528\u3002<\/p>\n<p>\u5927\u5e08\u5728\u8bc4\u5ba1\u4f1a\u4e0a\u6307\u51fa&#xff1a;\u201cHTTPS\u4e0d\u662f\u7b80\u5355\u5730\u52a0\u4e0a\u4e00\u5f20\u8bc1\u4e66\u5c31\u80fd\u9ad8\u6795\u65e0\u5fe7\u3002TLS\u534f\u8bae\u672c\u8eab\u6709\u591a\u4e2a\u7248\u672c&#xff08;1.0\/1.1\/1.2\/1.3&#xff09;&#xff0c;\u6bcf\u4e2a\u7248\u672c\u7684\u5b89\u5168\u6027\u5dee\u5f02\u5de8\u5927&#xff1b;\u63e1\u624b\u8fc7\u7a0b\u6d89\u53ca\u975e\u5bf9\u79f0\u52a0\u5bc6\u3001\u5bf9\u79f0\u52a0\u5bc6\u3001\u8bc1\u4e66\u9a8c\u8bc1\u7b49\u591a\u4e2a\u73af\u8282&#xff0c;\u4efb\u4f55\u4e00\u73af\u914d\u7f6e\u4e0d\u5f53\u90fd\u4f1a\u5f71\u54cd\u5b89\u5168\u6027\u548c\u6027\u80fd\u3002\u6211\u4eec\u9700\u8981\u7cfb\u7edf\u6027\u5730\u7406\u89e3SSL\/TLS\u7684\u5b8c\u6574\u94fe\u8def&#xff0c;\u5e76\u5efa\u7acb\u4e00\u4e2a\u80fd\u83b7\u5f97Qualys A&#043;\u8bc4\u7ea7\u7684\u914d\u7f6e\u57fa\u7ebf\u3002\u201d<\/p>\n<p>\u4e8e\u662f&#xff0c;\u5927\u5e08\u5e26\u9886\u56e2\u961f\u8e0f\u4e0a\u4e86\u4eceHTTP\u5230HTTPS\u7684\u5b8c\u6574\u5347\u7ea7\u4e4b\u65c5\u3002<\/p>\n<hr \/>\n<h3>2. \u9879\u76ee\u8bbe\u8ba1<\/h3>\n<p>\u5468\u56db\u4e0a\u5348&#xff0c;\u5b89\u5168\u4e13\u9879\u4f1a\u8bae\u5ba4\u7684\u7a97\u5e18\u534a\u62c9\u7740&#xff0c;\u6c14\u6c1b\u6bd4\u5e73\u65f6\u4e25\u8083\u3002\u5c0f\u80d6\u9762\u524d\u644a\u7740SSL\u8bc1\u4e66\u6587\u4ef6\u548c\u4e00\u4e32openssl\u547d\u4ee4\u7684\u7b14\u8bb0\u3002\u5c0f\u767d\u6b63\u5728\u7528SSL Labs\u7684\u5728\u7ebf\u626b\u63cf\u5de5\u5177\u6d4b\u8bd5\u73b0\u7f51\u914d\u7f6e&#xff0c;\u5c4f\u5e55\u4e0a\u7684\u8bc4\u7ea7\u8d6b\u7136\u663e\u793a\u7740\u523a\u773c\u7684&#034;B&#034;\u3002\u5927\u5e08\u63a8\u95e8\u800c\u5165&#xff0c;\u624b\u91cc\u62ff\u7740\u6253\u5370\u51fa\u6765\u7684SSL\u63e1\u624b\u65f6\u5e8f\u56fe\u3002<\/p>\n<p>\u5c0f\u80d6&#xff08;\u62ac\u8d77\u5934&#xff0c;\u6709\u4e9b\u6cae\u4e27&#xff09;&#xff1a;\u201c\u5927\u5e08&#xff0c;\u8bc1\u4e66\u6211\u5df2\u7ecf\u914d\u597d\u4e86&#xff0c;\u6d4f\u89c8\u5668\u8bbf\u95ee\u4e5f\u80fd\u770b\u5230\u5c0f\u7eff\u9501\u3002\u4e3a\u4ec0\u4e48\u5c0f\u767d\u7684\u626b\u63cf\u5de5\u5177\u53ea\u7ed9\u4e86B\u7ea7&#xff1f;\u6211\u770b\u7f51\u4e0a\u6709\u4eba\u8bf4\u914d\u4e86\u8bc1\u4e66\u5c31\u662fHTTPS\u4e86\u3002\u201d<\/p>\n<p>\u5927\u5e08&#xff08;\u628a\u65f6\u5e8f\u56fe\u644a\u5728\u684c\u4e0a&#xff09;&#xff1a;\u201c\u5c0f\u7eff\u9501\u53ea\u662f\u6700\u57fa\u7840\u7684\u95e8\u69db\u3002SSL Labs\u7684\u8bc4\u7ea7\u4eceF\u5230A&#043;&#xff0c;\u6d89\u53ca\u534f\u8bae\u7248\u672c\u3001\u5bc6\u94a5\u4ea4\u6362\u3001\u8bc1\u4e66\u5f3a\u5ea6\u3001Forward Secrecy\u3001HSTS\u7b49\u591a\u4e2a\u7ef4\u5ea6\u3002\u4f60\u53ea\u5b8c\u6210\u4e86\u2019\u6709\u8bc1\u4e66\u2019\u8fd9\u4e00\u6b65&#xff0c;\u8ddd\u79bb\u751f\u4ea7\u7ea7\u5b89\u5168\u8fd8\u5dee\u5f97\u8fdc\u3002\u201d<\/p>\n<p>\u5c0f\u767d&#xff08;\u628a\u7b14\u8bb0\u672c\u8f6c\u5411\u5927\u5bb6&#xff09;&#xff1a;\u201c\u6211\u5217\u4e86\u4e00\u4e0b\u6211\u4eec\u73b0\u7f51\u7684\u95ee\u9898&#xff1a;\u7b2c\u4e00&#xff0c;\u670d\u52a1\u5668\u4ecd\u63a5\u53d7TLS 1.0\u548cTLS 1.1\u8fde\u63a5&#xff0c;\u8fd9\u4e24\u4e2a\u534f\u8bae\u5df2\u7ecf\u88abPOODLE\u3001BEAST\u7b49\u653b\u51fb\u8bc1\u660e\u4e0d\u5b89\u5168&#xff1b;\u7b2c\u4e8c&#xff0c;\u8bc1\u4e66\u94fe\u53ea\u53d1\u4e86\u670d\u52a1\u5668\u8bc1\u4e66&#xff0c;\u6ca1\u6709\u5305\u542b\u4e2d\u95f4CA\u8bc1\u4e66&#xff0c;Android\u4f4e\u7248\u672c\u8bbe\u5907\u76f4\u63a5\u62a5\u8bc1\u4e66\u4e0d\u53d7\u4fe1\u4efb&#xff1b;\u7b2c\u4e09&#xff0c;\u6ca1\u6709\u542f\u7528OCSP Stapling&#xff0c;\u6bcf\u6b21\u65b0\u8fde\u63a5\u90fd\u8981\u5411CA\u7684OCSP\u670d\u52a1\u5668\u67e5\u8be2\u8bc1\u4e66\u540a\u9500\u72b6\u6001&#xff0c;\u589e\u52a0\u4e86200\u5230400\u6beb\u79d2\u7684\u5ef6\u8fdf&#xff1b;\u7b2c\u56db&#xff0c;HTTP Strict Transport Security&#xff08;HSTS&#xff09;\u6ca1\u914d&#xff0c;\u7528\u6237\u7b2c\u4e00\u6b21\u901a\u8fc7HTTP\u8bbf\u95ee\u65f6\u4ecd\u5b58\u5728\u88ab\u52ab\u6301\u7684\u98ce\u9669\u3002\u201d<\/p>\n<p>\u5927\u5e08&#xff08;\u70b9\u70b9\u5934&#xff09;&#xff1a;\u201c\u5c0f\u767d\u603b\u7ed3\u5f97\u975e\u5e38\u5168\u9762\u3002\u8ba9\u6211\u5148\u5e26\u4f60\u4eec\u56de\u987e\u4e00\u4e0bSSL\/TLS\u63e1\u624b\u7684\u5b8c\u6574\u6d41\u7a0b&#xff0c;\u7406\u89e3\u4e86\u539f\u7406&#xff0c;\u914d\u7f6e\u624d\u6709\u7075\u9b42\u3002\u201d<\/p>\n<p>\u5927\u5e08\u5728\u767d\u677f\u4e0a\u753b\u4e0bTLS 1.2\u7684\u63e1\u624b\u65f6\u5e8f\u56fe&#xff1a;<\/p>\n<p>\u5ba2\u6237\u7aef                                    \u670d\u52a1\u5668<br \/>\n  |                                         |<br \/>\n  | &#8212;&#8212;&#8211; ClientHello &#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&gt; |  \u652f\u6301\u7684TLS\u7248\u672c\u3001\u5bc6\u7801\u5957\u4ef6\u3001\u968f\u673a\u6570<br \/>\n  |                                         |<br \/>\n  | &lt;&#8212;&#8212;- ServerHello &#8212;&#8212;&#8212;&#8212;&#8212;&#8211; |  \u9009\u5b9a\u7684TLS\u7248\u672c\u3001\u5bc6\u7801\u5957\u4ef6\u3001\u968f\u673a\u6570<br \/>\n  | &lt;&#8212;&#8212;- Certificate &#8212;&#8212;&#8212;&#8212;&#8212;&#8211; |  \u670d\u52a1\u5668\u8bc1\u4e66&#xff08;\u542b\u516c\u94a5&#xff09;<br \/>\n  | &lt;&#8212;&#8212;- ServerHelloDone &#8212;&#8212;&#8212;&#8212;- |<br \/>\n  |                                         |<br \/>\n  | &#8212;&#8212;&#8211; ClientKeyExchange &#8212;&#8212;&#8212;&#8211;&gt; |  \u7528\u670d\u52a1\u5668\u516c\u94a5\u52a0\u5bc6\u9884\u4e3b\u5bc6\u94a5<br \/>\n  | &#8212;&#8212;&#8211; [ChangeCipherSpec] &#8212;&#8212;&#8212;-&gt; |<br \/>\n  | &#8212;&#8212;&#8211; Finished &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&gt; |  \u52a0\u5bc6\u63e1\u624b\u5b8c\u6210<br \/>\n  |                                         |<br \/>\n  | &lt;&#8212;&#8212;- [ChangeCipherSpec] &#8212;&#8212;&#8212;- |<br \/>\n  | &lt;&#8212;&#8212;- Finished &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; |<br \/>\n  |                                         |<br \/>\n  | &lt;&#061;&#061;&#061;&#061;&#061;&#061;&#061; \u52a0\u5bc6\u5e94\u7528\u6570\u636e\u4f20\u8f93 &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&gt; |<\/p>\n<p>\u5927\u5e08&#xff08;\u6307\u7740\u56fe\u793a&#xff09;&#xff1a;\u201c\u8fd9\u662fTLS 1.2\u7684\u5b8c\u6574\u63e1\u624b&#xff0c;\u9700\u89812\u4e2aRTT&#xff08;\u5f80\u8fd4\u65f6\u5ef6&#xff09;\u3002\u63e1\u624b\u5b8c\u6210\u540e&#xff0c;\u53cc\u65b9\u534f\u5546\u51fa\u5bf9\u79f0\u52a0\u5bc6\u5bc6\u94a5&#xff0c;\u540e\u7eed\u5e94\u7528\u6570\u636e\u90fd\u7528\u8fd9\u4e2a\u5bc6\u94a5\u52a0\u5bc6\u4f20\u8f93\u3002TLS 1.3\u5bf9\u6b64\u505a\u4e86\u91cd\u5927\u4f18\u5316&#xff0c;\u628a\u63e1\u624b\u7f29\u51cf\u52301\u4e2aRTT&#xff0c;\u751a\u81f3\u5728\u4f1a\u8bdd\u6062\u590d\u573a\u666f\u4e0b\u53ef\u4ee5\u505a\u52300-RTT\u3002\u201d<\/p>\n<p>\u5c0f\u80d6&#xff08;\u76b1\u7740\u7709&#xff09;&#xff1a;\u201c\u5927\u5e08&#xff0c;\u6211\u542c\u8bf4\u63e1\u624b\u8fc7\u7a0b\u5f88\u8017CPU&#xff0c;\u56e0\u4e3a\u6d89\u53ca\u975e\u5bf9\u79f0\u52a0\u5bc6\u3002\u9c9c\u679c\u56ed\u7684QPS\u5cf0\u503c\u6709\u4e00\u4e07\u4e94&#xff0c;\u5168\u90e8HTTPS\u540e\u670d\u52a1\u5668\u625b\u5f97\u4f4f\u5417&#xff1f;\u201d<\/p>\n<p>\u5927\u5e08&#xff1a;\u201c\u8fd9\u662f\u4e2a\u597d\u95ee\u9898\u3002\u975e\u5bf9\u79f0\u52a0\u5bc6&#xff08;RSA\/ECDHE&#xff09;\u786e\u5b9e\u6bd4\u5bf9\u79f0\u52a0\u5bc6\u6d88\u8017\u66f4\u591aCPU&#xff0c;\u4f46\u73b0\u4ee3\u670d\u52a1\u5668\u786c\u4ef6\u901a\u5e38\u53ef\u4ee5\u627f\u53d7\u3002\u66f4\u91cd\u8981\u7684\u662f&#xff0c;TLS 1.3\u548cTLS 1.2\u652f\u6301ECDHE\u5bc6\u94a5\u4ea4\u6362&#xff0c;\u914d\u5408\u692d\u5706\u66f2\u7ebf\u7b97\u6cd5&#xff08;\u5982X25519&#xff09;&#xff0c;\u8ba1\u7b97\u5f00\u9500\u5df2\u7ecf\u5927\u5927\u964d\u4f4e\u3002\u6b64\u5916&#xff0c;Nginx\u7684SSL\u4f1a\u8bdd\u7f13\u5b58&#xff08;Session Cache&#xff09;\u548c\u4f1a\u8bdd\u7968\u636e&#xff08;Session Tickets&#xff09;\u53ef\u4ee5\u8ba9\u91cd\u590d\u8bbf\u95ee\u7684\u5ba2\u6237\u7aef\u590d\u7528\u4e4b\u524d\u7684\u63e1\u624b\u7ed3\u679c&#xff0c;\u8df3\u8fc7\u5b8c\u6574\u7684\u63e1\u624b\u6d41\u7a0b\u3002\u201d<\/p>\n<p>\u5c0f\u767d&#xff08;\u8ffd\u95ee&#xff09;&#xff1a;\u201cSession Cache\u548cSession Tickets\u6709\u4ec0\u4e48\u533a\u522b&#xff1f;\u201d<\/p>\n<p>\u5927\u5e08&#xff1a;\u201c\u4e24\u8005\u90fd\u662f\u4e3a\u4e86\u5b9e\u73b0\u4f1a\u8bdd\u6062\u590d&#xff08;Session Resumption&#xff09;&#xff0c;\u4f46\u673a\u5236\u4e0d\u540c\u3002\u201d<\/p>\n<p>\u201cSession Cache\u662f\u670d\u52a1\u5668\u7aef\u7f13\u5b58&#xff1a;Nginx\u5728\u5185\u5b58\u4e2d\u4fdd\u5b58\u5df2\u534f\u5546\u7684\u4f1a\u8bdd\u53c2\u6570&#xff08;Session ID -&gt; \u4e3b\u5bc6\u94a5\u7684\u6620\u5c04&#xff09;\u3002\u5f53\u5ba2\u6237\u7aef\u5728\u540e\u7eed\u8fde\u63a5\u4e2d\u53d1\u9001\u76f8\u540c\u7684Session ID&#xff0c;\u670d\u52a1\u5668\u76f4\u63a5\u4ece\u7f13\u5b58\u4e2d\u67e5\u627e\u5e76\u6062\u590d\u4f1a\u8bdd\u3002\u4f18\u70b9\u662f\u7b80\u5355\u53ef\u9760&#xff0c;\u7f3a\u70b9\u662f\u5728\u591aworker\u6216\u591a\u673a\u96c6\u7fa4\u573a\u666f\u4e0b&#xff0c;\u7f13\u5b58\u4e0d\u5171\u4eab&#xff0c;\u547d\u4e2d\u7387\u53d7\u9650\u3002\u201d<\/p>\n<p>\u201cSession Tickets\u662f\u5ba2\u6237\u7aef\u7f13\u5b58&#xff1a;\u670d\u52a1\u5668\u628a\u4e00\u4e2a\u52a0\u5bc6\u8fc7\u7684\u4f1a\u8bdd\u72b6\u6001&#xff08;ticket&#xff09;\u53d1\u7ed9\u5ba2\u6237\u7aef&#xff0c;\u5ba2\u6237\u7aef\u5728\u540e\u7eed\u8fde\u63a5\u4e2d\u628a\u8fd9\u4e2aticket\u5e26\u56de\u6765&#xff0c;\u670d\u52a1\u5668\u89e3\u5bc6\u540e\u5373\u53ef\u6062\u590d\u4f1a\u8bdd\u3002\u4f18\u70b9\u662f\u72b6\u6001\u5b58\u50a8\u5728\u5ba2\u6237\u7aef&#xff0c;\u5929\u7136\u652f\u6301\u591a\u673a\u96c6\u7fa4&#xff1b;\u7f3a\u70b9\u662f\u5982\u679cticket\u5bc6\u94a5\u6cc4\u9732&#xff0c;\u653b\u51fb\u8005\u53ef\u4ee5\u89e3\u5bc6\u5386\u53f2\u6d41\u91cf\u2014\u2014\u4e0d\u8fc7\u53ea\u8981\u5b9a\u671f\u8f6e\u6362\u5bc6\u94a5&#xff0c;\u98ce\u9669\u662f\u53ef\u63a7\u7684\u3002\u201d<\/p>\n<p>\u5c0f\u80d6&#xff08;\u604d\u7136\u5927\u609f&#xff09;&#xff1a;\u201c\u90a3\u6211\u4eec\u662f\u4e0d\u662f\u4e24\u4e2a\u90fd\u5f00&#xff1f;\u201d<\/p>\n<p>\u5927\u5e08&#xff1a;\u201c\u662f\u7684&#xff0c;Nginx\u53ef\u4ee5\u540c\u65f6\u5f00\u542f\u4e24\u79cd\u673a\u5236&#xff0c;\u8ba9\u5ba2\u6237\u7aef\u81ea\u884c\u9009\u62e9\u652f\u6301\u7684\u65b9\u5f0f\u3002\u201d<\/p>\n<p>\u5c0f\u767d&#xff08;\u53c8\u629b\u51fa\u4e00\u4e2a\u95ee\u9898&#xff09;&#xff1a;\u201c\u5927\u5e08&#xff0c;OCSP Stapling\u53c8\u662f\u600e\u4e48\u56de\u4e8b&#xff1f;\u6211\u770b\u5230\u6709\u4e9b\u5927\u5382\u7684\u8bc1\u4e66\u914d\u7f6e\u91cc\u90fd\u6709\u8fd9\u4e2a\u3002\u201d<\/p>\n<p>\u5927\u5e08&#xff1a;\u201cOCSP&#xff08;Online Certificate Status Protocol&#xff09;\u662f\u8bc1\u4e66\u540a\u9500\u72b6\u6001\u67e5\u8be2\u534f\u8bae\u3002\u6b63\u5e38\u60c5\u51b5\u4e0b&#xff0c;\u5ba2\u6237\u7aef\u6536\u5230\u670d\u52a1\u5668\u8bc1\u4e66\u540e&#xff0c;\u9700\u8981\u5411CA\u7684OCSP\u670d\u52a1\u5668\u53d1\u4e00\u4e2aHTTP\u8bf7\u6c42&#xff0c;\u8be2\u95ee\u2019\u8fd9\u5f20\u8bc1\u4e66\u6709\u6ca1\u6709\u88ab\u540a\u9500\u2019\u3002\u8fd9\u4e2a\u67e5\u8be2\u4f1a\u589e\u52a0\u4e00\u6b21\u7f51\u7edc\u5f80\u8fd4&#xff0c;\u800c\u4e14\u5982\u679cCA\u7684OCSP\u670d\u52a1\u5668\u5b95\u673a\u6216\u7f51\u7edc\u4e0d\u901a&#xff0c;\u5ba2\u6237\u7aef\u53ef\u80fd\u65e0\u6cd5\u5b8c\u6210\u8bc1\u4e66\u9a8c\u8bc1\u3002\u201d<\/p>\n<p>\u201cOCSP Stapling\u7684\u5de7\u5999\u4e4b\u5904\u5728\u4e8e&#xff1a;\u7531\u670d\u52a1\u5668\u4e3b\u52a8\u5411CA\u67e5\u8be2OCSP\u54cd\u5e94&#xff0c;\u7136\u540e\u628a\u8fd9\u4e2a\u54cd\u5e94\u2019\u88c5\u8ba2\u2019&#xff08;Staple&#xff09;\u5230\u81ea\u5df1\u7684TLS\u63e1\u624b\u4e2d&#xff0c;\u968fCertificate\u6d88\u606f\u4e00\u8d77\u53d1\u7ed9\u5ba2\u6237\u7aef\u3002\u5ba2\u6237\u7aef\u6536\u5230\u540e&#xff0c;\u76f4\u63a5\u9a8c\u8bc1\u8fd9\u4e2a\u9884\u7f6e\u7684OCSP\u54cd\u5e94\u5373\u53ef&#xff0c;\u65e0\u9700\u518d\u5411\u5916\u53d1\u8d77\u67e5\u8be2\u3002\u8fd9\u6837\u65e2\u51cf\u5c11\u4e86\u5ef6\u8fdf&#xff0c;\u53c8\u51cf\u8f7b\u4e86CA\u670d\u52a1\u5668\u7684\u538b\u529b\u3002\u201d<\/p>\n<p>\u5c0f\u80d6&#xff08;\u62cd\u62cd\u8111\u888b&#xff09;&#xff1a;\u201c\u8fd9\u5c31\u50cf\u662f\u53bb\u98df\u5802\u5403\u996d\u65f6&#xff0c;\u7a97\u53e3\u963f\u59e8\u63d0\u524d\u628a\u5065\u5eb7\u8bc1\u590d\u5370\u4ef6\u8d34\u5728\u73bb\u7483\u4e0a&#xff0c;\u6211\u4eec\u4e0d\u7528\u518d\u53bb\u533b\u52a1\u5ba4\u67e5\u5979\u6709\u6ca1\u6709\u88ab\u540a\u9500\u5065\u5eb7\u8bc1\u4e86\u3002\u201d<\/p>\n<p>\u5927\u5e08&#xff08;\u5fcd\u4fca\u4e0d\u7981&#xff09;&#xff1a;\u201c\u6bd4\u55bb\u867d\u7136\u7c97\u7c9d&#xff0c;\u4f46\u9053\u7406\u662f\u5bf9\u7684\u3002\u201d<\/p>\n<p>\u5c0f\u767d&#xff08;\u7ee7\u7eed\u6df1\u5165&#xff09;&#xff1a;\u201cHSTS\u5934\u6211\u7406\u89e3\u4e86&#xff0c;\u5b83\u662f\u5f3a\u5236\u6d4f\u89c8\u5668\u53ea\u7528HTTPS\u8bbf\u95ee\u3002\u90a3HTTP\/2\u548cHTTPS\u6709\u4ec0\u4e48\u5173\u7cfb&#xff1f;\u201d<\/p>\n<p>\u5927\u5e08&#xff1a;\u201cHTTP\/2\u867d\u7136\u89c4\u8303\u4e0a\u5141\u8bb8\u8fd0\u884c\u5728\u660e\u6587TCP\u4e4b\u4e0a&#xff08;h2c&#xff09;&#xff0c;\u4f46\u6240\u6709\u4e3b\u6d41\u6d4f\u89c8\u5668\u90fd\u53ea\u652f\u6301\u57fa\u4e8eTLS\u7684HTTP\/2&#xff08;h2&#xff09;\u3002\u4e5f\u5c31\u662f\u8bf4&#xff0c;\u8981\u542f\u7528HTTP\/2&#xff0c;\u5fc5\u987b\u5148\u542f\u7528HTTPS\u3002HTTP\/2\u7684\u591a\u8def\u590d\u7528\u3001\u5934\u90e8\u538b\u7f29&#xff08;HPACK&#xff09;\u3001\u670d\u52a1\u5668\u63a8\u9001\u7b49\u7279\u6027&#xff0c;\u53ef\u4ee5\u5927\u5e45\u63d0\u5347HTTPS\u7684\u6027\u80fd&#xff0c;\u90e8\u5206\u62b5\u6d88TLS\u63e1\u624b\u5e26\u6765\u7684\u5f00\u9500\u3002\u201d<\/p>\n<p>\u5c0f\u80d6&#xff08;\u770b\u7740\u767d\u677f\u4e0a\u7684\u6ee1\u6ee1\u5185\u5bb9&#xff09;&#xff1a;\u201c\u539f\u6765HTTPS\u4e0d\u53ea\u662f\u52a0\u4e00\u5f20\u8bc1\u4e66&#xff0c;\u80cc\u540e\u6d89\u53ca\u5230\u534f\u8bae\u7248\u672c\u3001\u5bc6\u94a5\u4ea4\u6362\u3001\u4f1a\u8bdd\u6062\u590d\u3001\u8bc1\u4e66\u72b6\u6001\u3001\u4f20\u8f93\u5c42\u4f18\u5316\u8fd9\u4e48\u5e9e\u5927\u7684\u77e5\u8bc6\u4f53\u7cfb\u3002\u201d<\/p>\n<p>\u5927\u5e08&#xff08;\u6536\u8d77\u65f6\u5e8f\u56fe&#xff09;&#xff1a;\u201c\u6b63\u662f\u5982\u6b64\u3002\u5b89\u5168\u4ece\u6765\u4e0d\u662f\u5355\u70b9\u95ee\u9898&#xff0c;\u800c\u662f\u4e00\u4e2a\u7cfb\u7edf\u5de5\u7a0b\u3002\u73b0\u5728&#xff0c;\u6211\u4eec\u628a\u6240\u6709\u8fd9\u4e9b\u77e5\u8bc6\u70b9\u843d\u5730\u5230\u9c9c\u679c\u56ed\u7684\u914d\u7f6e\u4e2d\u3002\u201d<\/p>\n<hr \/>\n<h3>3. \u9879\u76ee\u5b9e\u6218<\/h3>\n<p>\u73af\u5883\u51c6\u5907<\/p>\n<ul>\n<li>Nginx 1.24.0&#xff08;\u6e90\u7801\u7f16\u8bd1\u65f6\u9700\u542f\u7528&#8211;with-http_ssl_module\u548c&#8211;with-http_v2_module&#xff09;<\/li>\n<li>OpenSSL 3.0&#043;&#xff08;\u652f\u6301TLS 1.3&#xff09;<\/li>\n<li>\u6709\u6548SSL\u8bc1\u4e66&#xff08;\u670d\u52a1\u5668\u8bc1\u4e66 &#043; \u4e2d\u95f4\u8bc1\u4e66 &#043; \u79c1\u94a5&#xff09;<\/li>\n<li>CentOS 8 \/ Ubuntu 22.04<\/li>\n<\/ul>\n<h4>\u6b65\u9aa4\u4e00&#xff1a;\u51c6\u5907SSL\u8bc1\u4e66\u6587\u4ef6<\/h4>\n<p>\u5047\u8bbe\u4f60\u5df2\u4eceCA\u673a\u6784\u83b7\u5f97\u4ee5\u4e0b\u6587\u4ef6&#xff1a;<\/p>\n<ul>\n<li>xian\u679c\u56ed.crt&#xff1a;\u670d\u52a1\u5668\u8bc1\u4e66<\/li>\n<li>xian\u679c\u56ed.key&#xff1a;\u670d\u52a1\u5668\u79c1\u94a5<\/li>\n<li>ca-chain.crt&#xff1a;\u4e2d\u95f4CA\u8bc1\u4e66\u94fe<\/li>\n<\/ul>\n<p>\u5173\u952e\u64cd\u4f5c&#xff1a;\u5408\u5e76\u8bc1\u4e66\u94fe<\/p>\n<p>\u5f88\u591a\u6d4f\u89c8\u5668\u62a5\u9519&#034;\u8bc1\u4e66\u4e0d\u53d7\u4fe1\u4efb&#034;&#xff0c;\u662f\u56e0\u4e3a\u670d\u52a1\u5668\u53ea\u53d1\u9001\u4e86\u7ec8\u7aef\u5b9e\u4f53\u8bc1\u4e66&#xff0c;\u6ca1\u6709\u9644\u5e26\u4e2d\u95f4\u8bc1\u4e66\u3002Nginx\u9700\u8981\u628a\u670d\u52a1\u5668\u8bc1\u4e66\u548c\u4e2d\u95f4\u8bc1\u4e66\u5408\u5e76\u5230\u4e00\u4e2a\u6587\u4ef6\u4e2d&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u670d\u52a1\u5668\u8bc1\u4e66\u5728\u524d&#xff0c;\u4e2d\u95f4\u8bc1\u4e66\u5728\u540e&#xff0c;\u4f9d\u6b21\u8ffd\u52a0<\/span><br \/>\n<span class=\"token function\">cat<\/span> xian\u679c\u56ed.crt ca-chain.crt <span class=\"token operator\">&gt;<\/span> xian\u679c\u56ed.fullchain.crt<\/p>\n<p><span class=\"token comment\"># \u9a8c\u8bc1\u8bc1\u4e66\u94fe\u5b8c\u6574\u6027<\/span><br \/>\nopenssl verify <span class=\"token parameter variable\">-CAfile<\/span> ca-chain.crt xian\u679c\u56ed.fullchain.crt<\/p>\n<p>\u9884\u671f\u8f93\u51fa&#xff1a;<\/p>\n<p>xian\u679c\u56ed.fullchain.crt: OK<\/p>\n<p>\u9a8c\u8bc1\u79c1\u94a5\u4e0e\u8bc1\u4e66\u5339\u914d&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u63d0\u53d6\u8bc1\u4e66\u7684\u516c\u94a5\u6a21\u6570<\/span><br \/>\nopenssl x509 <span class=\"token parameter variable\">-noout<\/span> <span class=\"token parameter variable\">-modulus<\/span> <span class=\"token parameter variable\">-in<\/span> xian\u679c\u56ed.crt <span class=\"token operator\">|<\/span> openssl md5<\/p>\n<p><span class=\"token comment\"># \u63d0\u53d6\u79c1\u94a5\u7684\u516c\u94a5\u6a21\u6570<\/span><br \/>\nopenssl rsa <span class=\"token parameter variable\">-noout<\/span> <span class=\"token parameter variable\">-modulus<\/span> <span class=\"token parameter variable\">-in<\/span> xian\u679c\u56ed.key <span class=\"token operator\">|<\/span> openssl md5<\/p>\n<p>\u4e24\u4e2aMD5\u503c\u5fc5\u987b\u5b8c\u5168\u4e00\u81f4&#xff0c;\u5426\u5219\u8bf4\u660e\u79c1\u94a5\u4e0e\u8bc1\u4e66\u4e0d\u5339\u914d\u3002<\/p>\n<h4>\u6b65\u9aa4\u4e8c&#xff1a;\u7f16\u5199Nginx\u914d\u7f6e\u6587\u4ef6<\/h4>\n<p>user  nginx;<br \/>\nworker_processes  auto;<\/p>\n<p>events {<br \/>\n    worker_connections  1024;<br \/>\n}<\/p>\n<p>http {<br \/>\n    include       mime.types;<br \/>\n    default_type  application\/octet-stream;<\/p>\n<p>    # &#061;&#061;&#061; \u65e5\u5fd7\u683c\u5f0f &#061;&#061;&#061;<br \/>\n    log_format ssl_log &#039;$remote_addr &#8211; $remote_user [$time_local] &#039;<br \/>\n                       &#039;&#034;$request&#034; $status $body_bytes_sent &#039;<br \/>\n                       &#039;&#034;$http_referer&#034; &#034;$http_user_agent&#034; &#039;<br \/>\n                       &#039;ssl_protocol&#061;&#034;$ssl_protocol&#034; ssl_cipher&#061;&#034;$ssl_cipher&#034; &#039;<br \/>\n                       &#039;rt&#061;$request_time&#039;;<\/p>\n<p>    access_log  logs\/access.log  ssl_log;<\/p>\n<p>    # &#061;&#061;&#061; HTTP 80\u7aef\u53e3&#xff1a;\u5f3a\u5236\u8df3\u8f6cHTTPS &#061;&#061;&#061;<br \/>\n    server {<br \/>\n        listen       80;<br \/>\n        server_name  www.xian\u679c\u56ed.com xian\u679c\u56ed.com;<\/p>\n<p>        # HSTS\u9884\u52a0\u8f7d&#xff08;\u4ec5\u5f53\u786e\u8ba4\u5168\u7ad9HTTPS\u5c31\u7eea\u540e\u5f00\u542f&#xff09;<br \/>\n        # add_header Strict-Transport-Security &#034;max-age&#061;63072000; includeSubDomains; preload&#034; always;<\/p>\n<p>        location \/ {<br \/>\n            return 301 https:\/\/$host$request_uri;<br \/>\n        }<br \/>\n    }<\/p>\n<p>    # &#061;&#061;&#061; HTTPS 443\u7aef\u53e3 &#061;&#061;&#061;<br \/>\n    server {<br \/>\n        listen       443 ssl http2;<br \/>\n        server_name  www.xian\u679c\u56ed.com xian\u679c\u56ed.com;<br \/>\n        root         \/data\/xian\u679c\u56ed\/static;<br \/>\n        index        index.html;<\/p>\n<p>        # &#061;&#061;&#061; SSL\u8bc1\u4e66\u914d\u7f6e &#061;&#061;&#061;<br \/>\n        ssl_certificate      \/etc\/nginx\/ssl\/xian\u679c\u56ed.fullchain.crt;<br \/>\n        ssl_certificate_key  \/etc\/nginx\/ssl\/xian\u679c\u56ed.key;<\/p>\n<p>        # &#061;&#061;&#061; SSL\u534f\u8bae\u7248\u672c&#xff1a;\u4ec5\u5141\u8bb8TLS 1.2\u548cTLS 1.3 &#061;&#061;&#061;<br \/>\n        ssl_protocols  TLSv1.2 TLSv1.3;<\/p>\n<p>        # &#061;&#061;&#061; \u5bc6\u7801\u5957\u4ef6\u914d\u7f6e &#061;&#061;&#061;<br \/>\n        # \u4f18\u5148\u4f7f\u7528\u652f\u6301Forward Secrecy\u7684\u5bc6\u7801\u5957\u4ef6<br \/>\n        ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:<br \/>\n                    ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:<br \/>\n                    ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:<br \/>\n                    DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;<br \/>\n        ssl_prefer_server_ciphers  off;  # TLS 1.3\u4e2d\u6b64\u8bbe\u7f6e\u65e0\u6548&#xff0c;\u4ea4\u7531\u5ba2\u6237\u7aef\u4f18\u5148\u9009\u62e9<\/p>\n<p>        # &#061;&#061;&#061; \u692d\u5706\u66f2\u7ebf\u504f\u597d &#061;&#061;&#061;<br \/>\n        ssl_ecdh_curve  X25519:secp384r1:secp256r1;<\/p>\n<p>        # &#061;&#061;&#061; SSL\u4f1a\u8bdd\u7f13\u5b58 &#061;&#061;&#061;<br \/>\n        ssl_session_cache  shared:SSL:50m;   # 50MB\u5171\u4eab\u7f13\u5b58&#xff0c;\u7ea6\u53ef\u5b58200\u4e07\u4e2a\u4f1a\u8bdd<br \/>\n        ssl_session_timeout  1d;             # \u4f1a\u8bdd\u6709\u6548\u671f1\u5929<br \/>\n        ssl_session_tickets  on;             # \u542f\u7528Session Tickets<\/p>\n<p>        # &#061;&#061;&#061; OCSP Stapling &#061;&#061;&#061;<br \/>\n        ssl_stapling        on;<br \/>\n        ssl_stapling_verify on;<\/p>\n<p>        # OCSP\u54cd\u5e94\u7684DNS\u89e3\u6790\u914d\u7f6e&#xff08;\u5fc5\u987b&#xff09;<br \/>\n        resolver  8.8.8.8 8.8.4.4 valid&#061;300s;<br \/>\n        resolver_timeout  5s;<\/p>\n<p>        # &#061;&#061;&#061; \u8bc1\u4e66\u900f\u660e\u5ea6&#xff08;Certificate Transparency&#xff09;&#061;&#061;&#061;<br \/>\n        # \u90e8\u5206CA\u63d0\u4f9b\u7684\u8bc1\u4e66\u5df2\u5185\u5d4cSCT&#xff0c;\u65e0\u9700\u989d\u5916\u914d\u7f6e<br \/>\n        # \u5982\u9700\u624b\u52a8\u6dfb\u52a0&#xff1a;ssl_ct_static_scts \/path\/to\/scts;<\/p>\n<p>        # &#061;&#061;&#061; \u5b89\u5168\u54cd\u5e94\u5934 &#061;&#061;&#061;<br \/>\n        # HSTS&#xff1a;\u5f3a\u5236\u6d4f\u89c8\u5668\u5728\u672a\u6765\u4e00\u6bb5\u65f6\u95f4\u5185\u53ea\u7528HTTPS\u8bbf\u95ee<br \/>\n        add_header Strict-Transport-Security &#034;max-age&#061;63072000; includeSubDomains&#034; always;<\/p>\n<p>        # \u9632\u6b62\u70b9\u51fb\u52ab\u6301<br \/>\n        add_header X-Frame-Options &#034;SAMEORIGIN&#034; always;<\/p>\n<p>        # XSS\u4fdd\u62a4<br \/>\n        add_header X-XSS-Protection &#034;1; mode&#061;block&#034; always;<\/p>\n<p>        # MIME\u7c7b\u578b\u55c5\u63a2\u4fdd\u62a4<br \/>\n        add_header X-Content-Type-Options &#034;nosniff&#034; always;<\/p>\n<p>        # \u5f15\u7528\u7b56\u7565<br \/>\n        add_header Referrer-Policy &#034;strict-origin-when-cross-origin&#034; always;<\/p>\n<p>        location \/ {<br \/>\n            try_files $uri $uri\/ \/index.html;<br \/>\n        }<\/p>\n<p>        location \/api\/ {<br \/>\n            proxy_pass http:\/\/127.0.0.1:8080;<br \/>\n            proxy_set_header Host $host;<br \/>\n            proxy_set_header X-Real-IP $remote_addr;<br \/>\n            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br \/>\n            proxy_set_header X-Forwarded-Proto $scheme;<br \/>\n        }<\/p>\n<p>        location \/health {<br \/>\n            access_log off;<br \/>\n            return 200 &#034;Nginx SSL is running\\\\n&#034;;<br \/>\n            add_header Content-Type text\/plain;<br \/>\n        }<br \/>\n    }<br \/>\n}<\/p>\n<p>\u914d\u7f6e\u8981\u70b9\u8bf4\u660e&#xff1a;<\/p>\n<li>\n<p>ssl_protocols TLSv1.2 TLSv1.3&#xff1a;\u7981\u7528\u5df2\u4e0d\u5b89\u5168\u7684TLS 1.0\/1.1\u548cSSLv3\u3002TLS 1.3\u5728\u63e1\u624b\u6548\u7387\u548c\u5b89\u5168\u6027\u4e0a\u90fd\u6709\u663e\u8457\u63d0\u5347\u3002<\/p>\n<\/li>\n<li>\n<p>ssl_ciphers&#xff1a;\u5bc6\u7801\u5957\u4ef6\u7684\u6392\u5e8f\u975e\u5e38\u5173\u952e\u3002\u5217\u8868\u4e2d\u4f18\u5148\u653e\u7f6e\u652f\u6301Forward Secrecy&#xff08;\u524d\u5411\u4fdd\u5bc6&#xff09;\u7684\u5957\u4ef6&#xff0c;\u5373\u4f7f\u670d\u52a1\u5668\u79c1\u94a5\u6cc4\u9732&#xff0c;\u4e5f\u65e0\u6cd5\u89e3\u5bc6\u5386\u53f2\u4f1a\u8bdd\u6570\u636e\u3002<\/p>\n<\/li>\n<li>\n<p>ssl_session_cache shared:SSL:50m&#xff1a;\u5728worker\u8fdb\u7a0b\u95f4\u5171\u4eab\u7684\u4f1a\u8bdd\u7f13\u5b58\u300250MB\u5927\u7ea6\u53ef\u5b58\u50a8200\u4e07\u4e2a\u4f1a\u8bdd&#xff0c;\u9002\u7528\u4e8e\u4e2d\u7b49\u89c4\u6a21\u7684\u7ad9\u70b9\u3002<\/p>\n<\/li>\n<li>\n<p>ssl_session_tickets on&#xff1a;\u542f\u7528Session Tickets&#xff0c;\u8ba9\u4e0d\u652f\u6301Session ID\u7684\u5ba2\u6237\u7aef\u4e5f\u80fd\u4eab\u53d7\u4f1a\u8bdd\u6062\u590d\u3002<\/p>\n<\/li>\n<li>\n<p>ssl_stapling on&#xff1a;\u5f00\u542fOCSP Stapling\u3002resolver\u6307\u4ee4\u5fc5\u987b\u914d\u7f6e&#xff0c;\u56e0\u4e3aNginx\u9700\u8981\u89e3\u6790OCSP\u54cd\u5e94\u670d\u52a1\u5668\u7684\u57df\u540d\u3002<\/p>\n<\/li>\n<li>\n<p>add_header Strict-Transport-Security&#xff1a;HSTS\u5934\u544a\u77e5\u6d4f\u89c8\u5668\u5728\u672a\u6765\u4e24\u5e74\u5185&#xff0c;\u5bf9\u8be5\u57df\u540d\u53ca\u5176\u5b50\u57df\u540d\u5f3a\u5236\u4f7f\u7528HTTPS\u8bbf\u95ee\u3002preload\u6807\u5fd7\u53ef\u7533\u8bf7\u52a0\u5165\u6d4f\u89c8\u5668\u7684HSTS\u9884\u52a0\u8f7d\u5217\u8868\u3002<\/p>\n<\/li>\n<h4>\u6b65\u9aa4\u4e09&#xff1a;\u8bed\u6cd5\u68c0\u67e5\u4e0e\u91cd\u8f7d<\/h4>\n<p>\/usr\/local\/nginx\/sbin\/nginx <span class=\"token parameter variable\">-t<\/span><br \/>\n\/usr\/local\/nginx\/sbin\/nginx <span class=\"token parameter variable\">-s<\/span> reload<\/p>\n<h4>\u6b65\u9aa4\u56db&#xff1a;\u9a8c\u8bc1\u6d4b\u8bd5<\/h4>\n<p>\u6d4b\u8bd5\u573a\u666f1&#xff1a;\u9a8c\u8bc1TLS\u7248\u672c\u548c\u5bc6\u7801\u5957\u4ef6<\/p>\n<p><span class=\"token comment\"># \u6d4b\u8bd5TLS 1.3\u8fde\u63a5<\/span><br \/>\nopenssl s_client <span class=\"token parameter variable\">-connect<\/span> www.xian\u679c\u56ed.com:443 <span class=\"token parameter variable\">-tls1_3<\/span><\/p>\n<p><span class=\"token comment\"># \u5728\u8f93\u51fa\u4e2d\u67e5\u627e&#xff1a;<\/span><br \/>\n<span class=\"token comment\"># Protocol  : TLSv1.3<\/span><br \/>\n<span class=\"token comment\"># Cipher    : TLS_AES_256_GCM_SHA384<\/span><\/p>\n<p><span class=\"token comment\"># \u6d4b\u8bd5TLS 1.2\u8fde\u63a5<\/span><br \/>\nopenssl s_client <span class=\"token parameter variable\">-connect<\/span> www.xian\u679c\u56ed.com:443 <span class=\"token parameter variable\">-tls1_2<\/span><\/p>\n<p><span class=\"token comment\"># \u6d4b\u8bd5\u88ab\u62d2\u7edd\u7684TLS 1.1<\/span><br \/>\nopenssl s_client <span class=\"token parameter variable\">-connect<\/span> www.xian\u679c\u56ed.com:443 <span class=\"token parameter variable\">-tls1_1<\/span><br \/>\n<span class=\"token comment\"># \u9884\u671f&#xff1a;\u63e1\u624b\u5931\u8d25<\/span><\/p>\n<p>\u6d4b\u8bd5\u573a\u666f2&#xff1a;\u9a8c\u8bc1OCSP Stapling<\/p>\n<p>openssl s_client <span class=\"token parameter variable\">-connect<\/span> www.xian\u679c\u56ed.com:443 <span class=\"token parameter variable\">-status<\/span><\/p>\n<p>\u5728\u8f93\u51fa\u4e2d\u67e5\u627eOCSP Response Status: successful&#xff0c;\u5e76\u4e14This Update\u548cNext Update\u65f6\u95f4\u5728\u5408\u7406\u8303\u56f4\u5185\u3002<\/p>\n<p>\u6d4b\u8bd5\u573a\u666f3&#xff1a;\u9a8c\u8bc1HTTP\/2<\/p>\n<p><span class=\"token function\">curl<\/span> <span class=\"token parameter variable\">-I<\/span> <span class=\"token parameter variable\">&#8211;http2<\/span> https:\/\/www.xian\u679c\u56ed.com\/<\/p>\n<p>\u9884\u671f\u54cd\u5e94\u5934\u5305\u542bHTTP\/2 200\u3002<\/p>\n<p>\u6d4b\u8bd5\u573a\u666f4&#xff1a;\u9a8c\u8bc1HSTS<\/p>\n<p><span class=\"token function\">curl<\/span> <span class=\"token parameter variable\">-I<\/span> https:\/\/www.xian\u679c\u56ed.com\/<\/p>\n<p>\u9884\u671f\u54cd\u5e94\u5934\u5305\u542b&#xff1a;<\/p>\n<p>strict-transport-security: max-age&#061;63072000; includeSubDomains<\/p>\n<p>\u6d4b\u8bd5\u573a\u666f5&#xff1a;SSL Labs\u626b\u63cf<\/p>\n<p>\u8bbf\u95ee https:\/\/www.ssllabs.com\/ssltest\/&#xff0c;\u8f93\u5165\u57df\u540d\u8fdb\u884c\u626b\u63cf\u3002<\/p>\n<p>\u9884\u671f\u7ed3\u679c&#xff1a;<\/p>\n<ul>\n<li>Overall Rating: A&#043;<\/li>\n<li>Certificate: 100%<\/li>\n<li>Protocol Support: 100%<\/li>\n<li>Key Exchange: 90%<\/li>\n<li>Cipher Strength: 90%<\/li>\n<\/ul>\n<h4>\u6b65\u9aa4\u4e94&#xff1a;\u6e90\u7801\u7ea7\u7406\u89e3<\/h4>\n<p>\u6253\u5f00src\/http\/modules\/ngx_http_ssl_module.c&#xff0c;\u67e5\u770bSSL\u914d\u7f6e\u6307\u4ee4\u7684\u6ce8\u518c&#xff1a;<\/p>\n<p><span class=\"token keyword\">static<\/span> <span class=\"token class-name\">ngx_command_t<\/span>  ngx_http_ssl_commands<span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">{<\/span><\/p>\n<p>    <span class=\"token punctuation\">{<\/span> <span class=\"token function\">ngx_string<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;ssl&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span><br \/>\n      NGX_HTTP_MAIN_CONF<span class=\"token operator\">|<\/span>NGX_HTTP_SRV_CONF<span class=\"token operator\">|<\/span>NGX_CONF_FLAG<span class=\"token punctuation\">,<\/span><br \/>\n      ngx_conf_set_flag_slot<span class=\"token punctuation\">,<\/span><br \/>\n      NGX_HTTP_SRV_CONF_OFFSET<span class=\"token punctuation\">,<\/span><br \/>\n      <span class=\"token function\">offsetof<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">ngx_http_ssl_srv_conf_t<\/span><span class=\"token punctuation\">,<\/span> enable<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span><br \/>\n      <span class=\"token constant\">NULL<\/span> <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">,<\/span><\/p>\n<p>    <span class=\"token punctuation\">{<\/span> <span class=\"token function\">ngx_string<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;ssl_certificate&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span><br \/>\n      NGX_HTTP_MAIN_CONF<span class=\"token operator\">|<\/span>NGX_HTTP_SRV_CONF<span class=\"token operator\">|<\/span>NGX_CONF_TAKE1<span class=\"token punctuation\">,<\/span><br \/>\n      ngx_http_ssl_certificate<span class=\"token punctuation\">,<\/span><br \/>\n      NGX_HTTP_SRV_CONF_OFFSET<span class=\"token punctuation\">,<\/span><br \/>\n      <span class=\"token number\">0<\/span><span class=\"token punctuation\">,<\/span><br \/>\n      <span class=\"token constant\">NULL<\/span> <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">,<\/span><\/p>\n<p>    <span class=\"token punctuation\">{<\/span> <span class=\"token function\">ngx_string<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;ssl_protocols&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span><br \/>\n      NGX_HTTP_MAIN_CONF<span class=\"token operator\">|<\/span>NGX_HTTP_SRV_CONF<span class=\"token operator\">|<\/span>NGX_CONF_1MORE<span class=\"token punctuation\">,<\/span><br \/>\n      ngx_conf_set_bitmask_slot<span class=\"token punctuation\">,<\/span><br \/>\n      NGX_HTTP_SRV_CONF_OFFSET<span class=\"token punctuation\">,<\/span><br \/>\n      <span class=\"token function\">offsetof<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">ngx_http_ssl_srv_conf_t<\/span><span class=\"token punctuation\">,<\/span> protocols<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span><br \/>\n      <span class=\"token operator\">&amp;<\/span>ngx_http_ssl_protocols <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">,<\/span><\/p>\n<p>    <span class=\"token comment\">\/* &#8230; \u66f4\u591a\u6307\u4ee4 &#8230; *\/<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>\u8fd9\u4e9b\u6307\u4ee4\u5728\u914d\u7f6e\u89e3\u6790\u9636\u6bb5\u88ab\u6ce8\u518c&#xff0c;\u6700\u7ec8\u8f6c\u6362\u4e3aOpenSSL\u7684API\u8c03\u7528\u3002<\/p>\n<p>\u518d\u770bsrc\/event\/ngx_event_openssl.c\u4e2d\u7684SSL\u4e0a\u4e0b\u6587\u521d\u59cb\u5316&#xff1a;<\/p>\n<p><span class=\"token class-name\">ngx_int_t<\/span><br \/>\n<span class=\"token function\">ngx_ssl_create<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">ngx_ssl_t<\/span> <span class=\"token operator\">*<\/span>ssl<span class=\"token punctuation\">,<\/span> <span class=\"token class-name\">ngx_uint_t<\/span> protocols<span class=\"token punctuation\">,<\/span> <span class=\"token keyword\">void<\/span> <span class=\"token operator\">*<\/span>data<span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token punctuation\">{<\/span><br \/>\n    SSL_CTX  <span class=\"token operator\">*<\/span>ctx<span class=\"token punctuation\">;<\/span><\/p>\n<p>    <span class=\"token comment\">\/\/ \u521d\u59cb\u5316OpenSSL\u5e93<\/span><br \/>\n    <span class=\"token function\">ngx_ssl_init<\/span><span class=\"token punctuation\">(<\/span>ssl<span class=\"token operator\">-&gt;<\/span>log<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>    <span class=\"token comment\">\/\/ \u521b\u5efaSSL\u4e0a\u4e0b\u6587<\/span><br \/>\n    ctx <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">SSL_CTX_new<\/span><span class=\"token punctuation\">(<\/span><span class=\"token function\">SSLv23_method<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>ctx <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token constant\">NULL<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token function\">ngx_ssl_error<\/span><span class=\"token punctuation\">(<\/span>NGX_LOG_EMERG<span class=\"token punctuation\">,<\/span> ssl<span class=\"token operator\">-&gt;<\/span>log<span class=\"token punctuation\">,<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">,<\/span><br \/>\n                      <span class=\"token string\">&#034;SSL_CTX_new() failed&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token keyword\">return<\/span> NGX_ERROR<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><\/p>\n<p>    <span class=\"token function\">SSL_CTX_set_options<\/span><span class=\"token punctuation\">(<\/span>ctx<span class=\"token punctuation\">,<\/span> SSL_OP_NO_SSLv2<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token function\">SSL_CTX_set_options<\/span><span class=\"token punctuation\">(<\/span>ctx<span class=\"token punctuation\">,<\/span> SSL_OP_NO_SSLv3<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">!<\/span><span class=\"token punctuation\">(<\/span>protocols <span class=\"token operator\">&amp;<\/span> NGX_SSL_TLSv1<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token function\">SSL_CTX_set_options<\/span><span class=\"token punctuation\">(<\/span>ctx<span class=\"token punctuation\">,<\/span> SSL_OP_NO_TLSv1<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">!<\/span><span class=\"token punctuation\">(<\/span>protocols <span class=\"token operator\">&amp;<\/span> NGX_SSL_TLSv1_1<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token function\">SSL_CTX_set_options<\/span><span class=\"token punctuation\">(<\/span>ctx<span class=\"token punctuation\">,<\/span> SSL_OP_NO_TLSv1_1<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">!<\/span><span class=\"token punctuation\">(<\/span>protocols <span class=\"token operator\">&amp;<\/span> NGX_SSL_TLSv1_2<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token function\">SSL_CTX_set_options<\/span><span class=\"token punctuation\">(<\/span>ctx<span class=\"token punctuation\">,<\/span> SSL_OP_NO_TLSv1_2<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token macro property\"><span class=\"token directive-hash\">#<\/span><span class=\"token directive keyword\">ifdef<\/span> <span class=\"token expression\">SSL_OP_NO_TLSv1_3<\/span><\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">!<\/span><span class=\"token punctuation\">(<\/span>protocols <span class=\"token operator\">&amp;<\/span> NGX_SSL_TLSv1_3<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token function\">SSL_CTX_set_options<\/span><span class=\"token punctuation\">(<\/span>ctx<span class=\"token punctuation\">,<\/span> SSL_OP_NO_TLSv1_3<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token macro property\"><span class=\"token directive-hash\">#<\/span><span class=\"token directive keyword\">endif<\/span><\/span><\/p>\n<p>    ssl<span class=\"token operator\">-&gt;<\/span>ctx <span class=\"token operator\">&#061;<\/span> ctx<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> NGX_OK<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u8fd9\u6bb5\u4ee3\u7801\u5c55\u793a\u4e86Nginx\u5982\u4f55\u5c06\u914d\u7f6e\u4e2d\u7684ssl_protocols\u8f6c\u6362\u4e3aOpenSSL\u7684\u534f\u8bae\u7981\u7528\u6807\u5fd7\u3002Nginx\u91c7\u7528&#034;\u53cd\u5411\u6392\u9664&#034;\u7b56\u7565&#xff1a;\u9ed8\u8ba4\u542f\u7528\u6240\u6709\u534f\u8bae&#xff0c;\u7136\u540e\u6839\u636e\u914d\u7f6e\u4e2d\u672a\u6307\u5b9a\u7684\u7248\u672c\u9010\u4e2a\u7981\u7528\u3002\u8fd9\u79cd\u8bbe\u8ba1\u4e0e\u76f4\u63a5\u6307\u5b9a\u542f\u7528\u7248\u672c\u76f8\u6bd4&#xff0c;\u517c\u5bb9\u6027\u66f4\u597d&#xff0c;\u7279\u522b\u662f\u5728OpenSSL\u5e93\u7248\u672c\u4e0d\u540c\u7684\u73af\u5883\u4e2d\u3002<\/p>\n<hr \/>\n<h4>\u6d4b\u8bd5\u9a8c\u8bc1<\/h4>\n<p><span class=\"token comment\"># \u57fa\u7840\u8fde\u901a\u6027\u9a8c\u8bc1&#xff08;\u793a\u4f8b&#xff09;<\/span><br \/>\n<span class=\"token function\">curl<\/span> <span class=\"token parameter variable\">-i<\/span> http:\/\/127.0.0.1:8080\/health<\/p>\n<p>\u9a8c\u8bc1\u8981\u70b9&#xff1a;<\/p>\n<ul>\n<li>\u5173\u952e\u63a5\u53e3\u8fd4\u56de\u7801\u7b26\u5408\u9884\u671f&#xff08;2xx\/4xx\/5xx\u4e0e\u8bbe\u8ba1\u4e00\u81f4&#xff09;&#xff1b;<\/li>\n<li>\u5173\u952e\u65e5\u5fd7\u5b57\u6bb5\u5b8c\u6574&#xff08;\u5982 request_id\u3001upstream \u8017\u65f6\u3001\u72b6\u6001\u7801&#xff09;&#xff1b;<\/li>\n<li>\u5728\u5c0f\u6d41\u91cf\u538b\u6d4b\u4e0b\u65e0\u5f02\u5e38\u9519\u8bef\u5cf0\u503c\u3002<\/li>\n<\/ul>\n<h3>4. \u9879\u76ee\u603b\u7ed3<\/h3>\n<p>\u7ecf\u8fc7\u672c\u7ae0\u7684\u7cfb\u7edf\u5347\u7ea7&#xff0c;\u9c9c\u679c\u56ed\u7684\u5168\u7ad9HTTPS\u8fc1\u79fb\u987a\u5229\u5b8c\u6210&#xff0c;SSL Labs\u8bc4\u7ea7\u4eceB\u63d0\u5347\u5230\u4e86A&#043;\u3002\u5c0f\u80d6\u548c\u5c0f\u767d\u4e0d\u4ec5\u5b66\u4f1a\u4e86\u8bc1\u4e66\u914d\u7f6e&#xff0c;\u66f4\u6df1\u5165\u7406\u89e3\u4e86TLS\u63e1\u624b\u3001\u4f1a\u8bdd\u6062\u590d\u3001OCSP Stapling\u7b49\u6838\u5fc3\u673a\u5236\u3002<\/p>\n<h4>\u4f18\u52a3\u5bf9\u6bd4&#xff1a;\u4e0d\u540cTLS\u7248\u672c\u4e0e\u914d\u7f6e\u7b56\u7565<\/h4>\n<table>\n<tr>\u7ef4\u5ea6TLS 1.2 &#043; RSATLS 1.2 &#043; ECDHETLS 1.3<\/tr>\n<tbody>\n<tr>\n<td>\u63e1\u624bRTT<\/td>\n<td>2-RTT<\/td>\n<td>2-RTT<\/td>\n<td>1-RTT&#xff08;0-RTT\u6062\u590d&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>Forward Secrecy<\/td>\n<td>\u4e0d\u652f\u6301&#xff08;RSA\u5bc6\u94a5\u4ea4\u6362&#xff09;<\/td>\n<td>\u652f\u6301<\/td>\n<td>\u5f3a\u5236\u652f\u6301<\/td>\n<\/tr>\n<tr>\n<td>CPU\u6d88\u8017<\/td>\n<td>\u4e2d\u7b49<\/td>\n<td>\u8f83\u4f4e&#xff08;\u692d\u5706\u66f2\u7ebf&#xff09;<\/td>\n<td>\u8f83\u4f4e<\/td>\n<\/tr>\n<tr>\n<td>\u517c\u5bb9\u6027<\/td>\n<td>\u6781\u597d&#xff08;\u8001\u65e7\u5ba2\u6237\u7aef&#xff09;<\/td>\n<td>\u597d<\/td>\n<td>\u8f83\u5dee&#xff08;\u9700\u8f83\u65b0\u5ba2\u6237\u7aef&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u5bc6\u7801\u5957\u4ef6\u6570\u91cf<\/td>\n<td>\u591a&#xff08;\u914d\u7f6e\u590d\u6742&#xff09;<\/td>\n<td>\u591a&#xff08;\u914d\u7f6e\u590d\u6742&#xff09;<\/td>\n<td>\u5c11&#xff08;\u4ec55\u4e2a&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u5b89\u5168\u6027<\/td>\n<td>\u4e00\u822c<\/td>\n<td>\u597d<\/td>\n<td>\u6781\u597d<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>\u9002\u7528\u573a\u666f<\/h4>\n<li>\u5168\u7ad9HTTPS\u8fc1\u79fb&#xff1a;\u7535\u5546\u3001\u91d1\u878d\u3001\u793e\u4ea4\u7b49\u6d89\u53ca\u7528\u6237\u9690\u79c1\u548c\u4ea4\u6613\u7684\u7f51\u7ad9&#xff0c;\u5fc5\u987b\u5168\u7ad9HTTPS\u3002<\/li>\n<li>HTTP\/2\u90e8\u7f72&#xff1a;\u9700\u8981\u591a\u8def\u590d\u7528\u3001\u5934\u90e8\u538b\u7f29\u7b49\u7279\u6027\u7684\u73b0\u4ee3Web\u5e94\u7528\u3002<\/li>\n<li>API\u7f51\u5173\u5b89\u5168&#xff1a;\u5bf9\u5916\u66b4\u9732\u7684RESTful API&#xff0c;\u9700\u8981TLS\u52a0\u5bc6\u548c\u8bc1\u4e66\u53cc\u5411\u8ba4\u8bc1&#xff08;mTLS&#xff09;\u3002<\/li>\n<li>\u5fae\u670d\u52a1\u95f4\u901a\u4fe1&#xff1a;\u670d\u52a1\u7f51\u683c&#xff08;Service Mesh&#xff09;\u4e2dsidecar\u4ee3\u7406\u7684TLS\u52a0\u5bc6\u901a\u9053\u3002<\/li>\n<li>\u5408\u89c4\u8981\u6c42&#xff1a;\u7b49\u4fdd2.0\u3001PCI DSS\u7b49\u5b89\u5168\u5408\u89c4\u6807\u51c6\u5bf9\u4f20\u8f93\u5c42\u52a0\u5bc6\u6709\u660e\u786e\u8981\u6c42\u3002<\/li>\n<h4>\u4e0d\u9002\u7528\u573a\u666f<\/h4>\n<li>\u7eaf\u5185\u7f51\u670d\u52a1&#xff1a;\u5728\u53d7\u4fe1\u4efb\u7684\u5185\u7f51\u73af\u5883\u4e2d&#xff0c;\u5982\u679c\u6027\u80fd\u654f\u611f\u4e14\u5b89\u5168\u57df\u5df2\u9694\u79bb&#xff0c;\u53ef\u4ee5\u4e0d\u542f\u7528TLS\u3002<\/li>\n<li>\u5d4c\u5165\u5f0f\/IoT\u8bbe\u5907&#xff1a;\u8d44\u6e90\u6781\u5ea6\u53d7\u9650\u7684\u8bbe\u5907\u53ef\u80fd\u65e0\u6cd5\u5b8c\u6210TLS\u63e1\u624b\u6240\u9700\u7684\u8ba1\u7b97\u548c\u5185\u5b58\u5f00\u9500\u3002<\/li>\n<li>\u5f00\u53d1\u6d4b\u8bd5\u73af\u5883&#xff1a;\u672c\u5730\u5f00\u53d1\u73af\u5883\u53ef\u4ee5\u4f7f\u7528\u81ea\u7b7e\u540d\u8bc1\u4e66&#xff0c;\u4f46\u4e0d\u9700\u8981\u751f\u4ea7\u7ea7\u7684HSTS\u548cOCSP\u914d\u7f6e\u3002<\/li>\n<h4>\u6ce8\u610f\u4e8b\u9879\u4e0e\u8b66\u544a<\/h4>\n<ul>\n<li>\u8bc1\u4e66\u6709\u6548\u671f&#xff1a;Let\u2019s Encrypt\u8bc1\u4e66\u6709\u6548\u671f90\u5929&#xff0c;\u9700\u914d\u7f6e\u81ea\u52a8\u7eed\u671f&#xff08;certbot\u7b49&#xff09;\u3002\u5546\u4e1a\u8bc1\u4e66\u901a\u5e381\u52302\u5e74&#xff0c;\u6ce8\u610f\u5230\u671f\u63d0\u9192\u3002<\/li>\n<li>HSTS\u98ce\u9669&#xff1a;\u4e00\u65e6\u5f00\u542fHSTS\u4e14max-age\u8bbe\u5f97\u5f88\u957f&#xff0c;\u5982\u679cHTTPS\u914d\u7f6e\u6709\u95ee\u9898&#xff0c;\u7528\u6237\u5c06\u65e0\u6cd5\u901a\u8fc7HTTP\u8bbf\u95ee\u6765\u7ed5\u8fc7\u3002\u5efa\u8bae\u5148\u5728max-age&#061;300&#xff08;5\u5206\u949f&#xff09;\u6d4b\u8bd5&#xff0c;\u786e\u8ba4\u65e0\u8bef\u540e\u518d\u63d0\u5347\u523063072000&#xff08;2\u5e74&#xff09;\u3002<\/li>\n<li>\u6df7\u5408\u5185\u5bb9&#xff08;Mixed Content&#xff09;&#xff1a;\u9875\u9762\u4e2d\u52a0\u8f7dHTTP\u8d44\u6e90&#xff08;\u56fe\u7247\u3001JS\u3001CSS&#xff09;\u4f1a\u5bfc\u81f4\u6d4f\u89c8\u5668\u5b89\u5168\u8b66\u544a\u3002\u5168\u7ad9\u8fc1\u79fb\u65f6\u9700\u540c\u6b65\u68c0\u67e5\u6240\u6709\u8d44\u6e90\u5f15\u7528\u3002<\/li>\n<li>TLS 1.3\u4e0e\u4e2d\u95f4\u4ef6\u517c\u5bb9\u6027&#xff1a;\u90e8\u5206\u8001\u65e7\u7684\u4f01\u4e1a\u7ea7\u5b89\u5168\u8bbe\u5907&#xff08;\u5982WAF\u3001IDS&#xff09;\u53ef\u80fd\u65e0\u6cd5\u6b63\u786e\u89e3\u6790TLS 1.3\u6d41\u91cf&#xff0c;\u5347\u7ea7\u524d\u9700\u6d4b\u8bd5\u3002<\/li>\n<li>0-RTT\u91cd\u653e\u653b\u51fb&#xff1a;TLS 1.3\u76840-RTT\u4f1a\u8bdd\u6062\u590d\u867d\u7136\u6027\u80fd\u6700\u4f18&#xff0c;\u4f46\u5b58\u5728\u91cd\u653e\u653b\u51fb\u98ce\u9669\u3002\u5bf9\u4e8e\u975e\u5e42\u7b49\u8bf7\u6c42&#xff08;\u5982POST\u8ba2\u5355&#xff09;&#xff0c;\u5e94\u5728\u5e94\u7528\u5c42\u505a\u9632\u91cd\u653e\u5904\u7406&#xff0c;\u6216\u7981\u75280-RTT\u3002<\/li>\n<\/ul>\n<h4>\u751f\u4ea7\u73af\u5883\u4e09\u5927\u8e29\u5751\u5b9e\u5f55<\/h4>\n<p>\u6848\u4f8b\u4e00&#xff1a;\u8bc1\u4e66\u94fe\u4e0d\u5b8c\u6574\u5bfc\u81f4\u79fb\u52a8\u7aef\u5927\u9762\u79ef\u62a5\u9519<\/p>\n<p>\u67d0\u7535\u5546\u516c\u53f8\u4e0a\u7ebfHTTPS\u540e&#xff0c;iOS\u7528\u6237\u6b63\u5e38&#xff0c;\u4f46\u5927\u91cfAndroid\u7528\u6237\u53cd\u9988&#034;\u8bc1\u4e66\u4e0d\u53d7\u4fe1\u4efb&#034;\u3002\u6392\u67e5\u53d1\u73b0\u670d\u52a1\u5668\u53ea\u53d1\u9001\u4e86\u7ec8\u7aef\u5b9e\u4f53\u8bc1\u4e66&#xff0c;\u6ca1\u6709\u9644\u5e26\u4e2d\u95f4CA\u8bc1\u4e66\u3002iOS\u8bbe\u5907\u901a\u5e38\u5185\u7f6e\u4e86\u5b8c\u6574\u7684\u4e2d\u95f4\u8bc1\u4e66&#xff0c;\u53ef\u4ee5\u81ea\u52a8\u8865\u5168\u94fe\u6761&#xff1b;\u800c\u90e8\u5206Android\u8bbe\u5907\u7f3a\u5c11\u8be5\u4e2d\u95f4\u8bc1\u4e66&#xff0c;\u5bfc\u81f4\u9a8c\u8bc1\u5931\u8d25\u3002\u89e3\u51b3\u65b9\u6848&#xff1a;\u4f7f\u7528cat server.crt intermediate.crt &gt; fullchain.crt\u5408\u5e76\u5b8c\u6574\u8bc1\u4e66\u94fe\u3002<\/p>\n<p>\u6848\u4f8b\u4e8c&#xff1a;OCSP Stapling\u914d\u7f6e\u9057\u6f0fresolver\u5bfc\u81f4\u63e1\u624b\u5076\u53d1\u8d85\u65f6<\/p>\n<p>\u67d0\u516c\u53f8\u5728Nginx\u4e2d\u5f00\u542f\u4e86ssl_stapling on&#xff0c;\u4f46\u6ca1\u6709\u914d\u7f6eresolver\u6307\u4ee4\u3002\u7ed3\u679cOCSP\u67e5\u8be2\u7684DNS\u89e3\u6790\u5076\u5c14\u8d85\u65f6&#xff08;\u9ed8\u8ba4\u4f7f\u7528\u7cfb\u7edf\/etc\/resolv.conf&#xff09;&#xff0c;\u5bfc\u81f4\u90e8\u5206TLS\u63e1\u624b\u8017\u65f6\u4ece100ms\u66b4\u589e\u52305\u79d2\u4ee5\u4e0a\u3002\u89e3\u51b3\u65b9\u6848&#xff1a;\u663e\u5f0f\u914d\u7f6e\u53ef\u9760\u7684DNS resolver&#xff0c;\u5982resolver 8.8.8.8 8.8.4.4 valid&#061;300s;&#xff0c;\u5e76\u8bbe\u7f6e\u5408\u7406\u7684resolver_timeout\u3002<\/p>\n<p>\u6848\u4f8b\u4e09&#xff1a;HSTS\u9884\u52a0\u8f7d\u7533\u8bf7\u540e\u65e0\u6cd5\u56de\u6edaHTTP<\/p>\n<p>\u67d0\u516c\u53f8\u5728\u672a\u5b8c\u5168\u786e\u8ba4\u5168\u7ad9HTTPS\u5c31\u7eea\u7684\u60c5\u51b5\u4e0b&#xff0c;\u5c31\u5f00\u542f\u4e86preload\u6807\u5fd7\u5e76\u7533\u8bf7\u52a0\u5165Chrome\u7684HSTS\u9884\u52a0\u8f7d\u5217\u8868\u3002\u7ed3\u679c\u90e8\u5206\u5b50\u57df\u540d\u8fd8\u6709HTTP-only\u7684\u670d\u52a1&#xff0c;\u88ab\u5f3a\u5236HTTPS\u540e\u65e0\u6cd5\u8bbf\u95ee\u3002\u7531\u4e8e\u9884\u52a0\u8f7d\u5217\u8868\u88ab\u786c\u7f16\u7801\u5230\u6d4f\u89c8\u5668\u4e2d&#xff0c;\u79fb\u9664\u9700\u8981\u6570\u5468\u5230\u6570\u6708\u7684\u66f4\u65b0\u65f6\u95f4\u3002\u89e3\u51b3\u65b9\u6848&#xff1a;HSTS\u5206\u9636\u6bb5 rollout&#xff0c;\u5148\u5c0fmax-age\u6d4b\u8bd5&#xff0c;\u786e\u8ba4\u5168\u7ad9\u65e0\u8bef\u540e\u518d\u7533\u8bf7\u9884\u52a0\u8f7d\u3002<\/p>\n<h4>\u8fdb\u9636\u601d\u8003\u9898<\/h4>\n<p>\u601d\u8003\u98981&#xff1a;TLS 1.3\u76840-RTT\u4f1a\u8bdd\u6062\u590d\u673a\u5236\u867d\u7136\u80fd\u663e\u8457\u964d\u4f4e\u91cd\u590d\u8fde\u63a5\u7684\u5ef6\u8fdf&#xff0c;\u4f46\u5b83\u5f15\u5165\u4e86\u91cd\u653e\u653b\u51fb&#xff08;Replay Attack&#xff09;\u7684\u98ce\u9669\u3002\u8bf7\u5206\u6790&#xff1a;\u4e3a\u4ec0\u4e480-RTT\u5bb9\u6613\u53d7\u5230\u91cd\u653e\u653b\u51fb&#xff1f;Nginx\u548cOpenSSL\u76ee\u524d\u5bf90-RTT\u7684\u9ed8\u8ba4\u7b56\u7565\u662f\u4ec0\u4e48&#xff1f;\u5728\u9c9c\u679c\u56ed\u7684\u7535\u5546\u573a\u666f\u4e2d&#xff0c;\u54ea\u4e9b\u7c7b\u578b\u7684\u8bf7\u6c42\u7edd\u5bf9\u4e0d\u80fd\u4f7f\u75280-RTT&#xff0c;\u4e3a\u4ec0\u4e48&#xff1f;<\/p>\n<p>\u63d0\u793a&#xff1a;\u7814\u7a76TLS 1.3\u7684Early Data\u673a\u5236&#xff0c;\u4ee5\u53caIETF RFC 8446\u4e2d\u5bf90-RTT\u5b89\u5168\u6027\u7684\u8ba8\u8bba\u3002\u601d\u8003POST\u8ba2\u5355\u3001\u652f\u4ed8\u8bf7\u6c42\u7b49\u975e\u5e42\u7b49\u64cd\u4f5c\u7684\u98ce\u9669\u3002<\/p>\n<p>\u601d\u8003\u98982&#xff1a;\u5728\u5927\u578b\u5206\u5e03\u5f0f\u67b6\u6784\u4e2d&#xff0c;Nginx\u901a\u5e38\u91c7\u7528\u591aworker\u8fdb\u7a0b\u751a\u81f3\u591a\u673a\u90e8\u7f72\u3002ssl_session_cache\u7684shared\u5185\u5b58\u7f13\u5b58\u867d\u7136\u53ef\u4ee5\u5728\u540c\u4e00\u53f0\u673a\u5668\u7684worker\u95f4\u5171\u4eab&#xff0c;\u4f46\u65e0\u6cd5\u8de8\u673a\u5668\u5171\u4eab\u3002\u5047\u8bbe\u9c9c\u679c\u56ed\u670910\u53f0Nginx\u5165\u53e3\u670d\u52a1\u5668&#xff0c;\u5982\u4f55\u8bbe\u8ba1\u4e00\u79cd\u5206\u5e03\u5f0fSSL\u4f1a\u8bdd\u6062\u590d\u65b9\u6848&#xff0c;\u4f7f\u5f97\u5ba2\u6237\u7aef\u65e0\u8bba\u8fde\u63a5\u5230\u54ea\u53f0\u670d\u52a1\u5668&#xff0c;\u90fd\u80fd\u590d\u7528\u4e4b\u524d\u7684\u4f1a\u8bdd&#xff1f;\u8bf7\u5bf9\u6bd4Redis\u96c6\u4e2d\u5b58\u50a8\u3001IP Hash\u8d1f\u8f7d\u5747\u8861\u3001\u4ee5\u53caTLS 1.3\u7684PSK&#xff08;Pre-Shared Key&#xff09;\u6a21\u5f0f\u7684\u4f18\u52a3\u3002<\/p>\n<p>\u63d0\u793a&#xff1a;\u7814\u7a76Nginx\u7684ssl_session_ticket_key\u6307\u4ee4&#xff0c;\u4ee5\u53ca\u901a\u8fc7\u5171\u4eabticket\u5bc6\u94a5\u6587\u4ef6\u5b9e\u73b0\u8de8\u673a\u4f1a\u8bdd\u6062\u590d\u7684\u53ef\u80fd\u6027\u3002<\/p>\n<hr \/>\n<p>\u4e0b\u4e00\u7ae0\u9884\u544a&#xff1a;\u7b2c13\u7ae0\u5c06\u6df1\u5165Nginx\u7684\u65e5\u5fd7\u7cfb\u7edf\u4e0e\u8bbf\u95ee\u63a7\u5236\u3002\u6211\u4eec\u5c06\u4ecengx_http_log_module.c\u548cngx_http_access_module.c\u6e90\u7801\u51fa\u53d1&#xff0c;\u638c\u63e1access_log\/error_log\u7684\u683c\u5f0f\u5b9a\u5236\u3001JSON\u7ed3\u6784\u5316\u65e5\u5fd7\u8f93\u51fa\u3001allow\/deny\u7684IP\u8bbf\u95ee\u63a7\u5236\u3001auth_basic\u57fa\u7840\u8ba4\u8bc1\u3001auth_request\u5b50\u8bf7\u6c42\u8ba4\u8bc1\u7b49\u5b9e\u6218\u6280\u5de7\u3002\u656c\u8bf7\u671f\u5f85\u300a\u7b2c13\u7ae0&#xff1a;\u65e5\u5fd7\u7cfb\u7edf\u4e0e\u8bbf\u95ee\u63a7\u5236\u300b&#xff01;<\/p>\n<h3>\u5ef6\u4f38\u9605\u8bfb\u4e0e\u8d44\u6e90<\/h3>\n<p>10\u500d\u5f00\u53d1\u8005\u7684 Dify \u9b54\u6cd5\u4e66&#xff1a;\u4ece\u96f6\u6784\u5efa\u5168\u6808 AI \u5e94\u7528 \u540e\u7aef\u5de5\u7a0b\u5e08\u8f6c\u578bAI\u7b2c\u4e00\u8bfe-Ollama \u4e0e\u79c1\u6709\u5316\u5927\u6a21\u578b\u5b9e\u6218 \u5927\u578b\u8bed\u8a00\u6a21\u578b(LLM) vLLM \u9ad8\u6027\u80fd\u63a8\u7406\u843d\u5730\u5b9e\u6218 Agent\u5f00\u53d1\u4e4bLlamaIndex \u5b9e\u6218\u4fee\u70bc\u4e0e\u6e90\u7801\u8fdb\u9636 \u5927\u8bed\u8a00\u6a21\u578bTransformers \u5b9e\u6218\u4fee\u70bc\u4e0e\u6e90\u7801\u5256\u6790<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\/* MD \/ \u5bcc\u6587\u672c\u4e2d\u7684 .toc\uff08\u542b\u535a\u5ba2\u56ed\u642c\u5bb6\u7b49\u5d4c\u5957\u7ed3\u6784\uff09\uff1b.toc-box \u5728\u4fa7\u680f\uff0c\u4e0d\u53d7\u5f71\u54cd *\/#content_views .toc,\/* \u7f16\u8f91\u5668\u5e38\u5728\u76ee\u5f55\u524d\u540e\u63d2\u5165\u7a7a p\uff08:empty \u4ecd\u5360 20px\uff09\uff0c\u4e00\u5e76\u53bb\u6389\u907f\u514d\u9876\u7a7a\u9699 *\/#content_views.markdown_views &gt; p:empty:has(+ .toc),#content_views.markdown_views &gt; .toc + p:empty,\/* \u5bcc\u6587\u672c\u65e7\u7248\u76ee\u5f55\u6807\u8bb0 *\/#content<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[13984,11598,622,117,606],"topic":[],"class_list":["post-122283","post","type-post","status-publish","format-standard","hentry","category-server","tag-hsts","tag-11598","tag-https","tag-nginx","tag-ssl"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u7b2c12\u7ae0\uff1aNginx SSL\/TLS \u914d\u7f6e\u4e0e HTTPS \u5b9e\u6218 - \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\/122283.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u7b2c12\u7ae0\uff1aNginx SSL\/TLS \u914d\u7f6e\u4e0e HTTPS \u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\/* MD \/ \u5bcc\u6587\u672c\u4e2d\u7684 .toc\uff08\u542b\u535a\u5ba2\u56ed\u642c\u5bb6\u7b49\u5d4c\u5957\u7ed3\u6784\uff09\uff1b.toc-box \u5728\u4fa7\u680f\uff0c\u4e0d\u53d7\u5f71\u54cd *\/#content_views .toc,\/* \u7f16\u8f91\u5668\u5e38\u5728\u76ee\u5f55\u524d\u540e\u63d2\u5165\u7a7a p\uff08:empty \u4ecd\u5360 20px\uff09\uff0c\u4e00\u5e76\u53bb\u6389\u907f\u514d\u9876\u7a7a\u9699 *\/#content_views.markdown_views &gt; p:empty:has(+ .toc),#content_views.markdown_views &gt; .toc + p:empty,\/* \u5bcc\u6587\u672c\u65e7\u7248\u76ee\u5f55\u6807\u8bb0 *\/#content\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/122283.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-11-04T07:24:46+00:00\" \/>\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=\"10 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/122283.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/122283.html\",\"name\":\"\u7b2c12\u7ae0\uff1aNginx SSL\/TLS \u914d\u7f6e\u4e0e HTTPS \u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-11-04T07:24:46+00:00\",\"dateModified\":\"2026-11-04T07:24:46+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/122283.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/122283.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/122283.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u7b2c12\u7ae0\uff1aNginx SSL\/TLS \u914d\u7f6e\u4e0e HTTPS \u5b9e\u6218\"}]},{\"@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":"\u7b2c12\u7ae0\uff1aNginx SSL\/TLS \u914d\u7f6e\u4e0e HTTPS \u5b9e\u6218 - \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\/122283.html","og_locale":"zh_CN","og_type":"article","og_title":"\u7b2c12\u7ae0\uff1aNginx SSL\/TLS \u914d\u7f6e\u4e0e HTTPS \u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\/* MD \/ \u5bcc\u6587\u672c\u4e2d\u7684 .toc\uff08\u542b\u535a\u5ba2\u56ed\u642c\u5bb6\u7b49\u5d4c\u5957\u7ed3\u6784\uff09\uff1b.toc-box \u5728\u4fa7\u680f\uff0c\u4e0d\u53d7\u5f71\u54cd *\/#content_views .toc,\/* \u7f16\u8f91\u5668\u5e38\u5728\u76ee\u5f55\u524d\u540e\u63d2\u5165\u7a7a p\uff08:empty \u4ecd\u5360 20px\uff09\uff0c\u4e00\u5e76\u53bb\u6389\u907f\u514d\u9876\u7a7a\u9699 *\/#content_views.markdown_views &gt; p:empty:has(+ .toc),#content_views.markdown_views &gt; .toc + p:empty,\/* \u5bcc\u6587\u672c\u65e7\u7248\u76ee\u5f55\u6807\u8bb0 *\/#content","og_url":"https:\/\/www.wsisp.com\/helps\/122283.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-11-04T07:24:46+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"10 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/122283.html","url":"https:\/\/www.wsisp.com\/helps\/122283.html","name":"\u7b2c12\u7ae0\uff1aNginx SSL\/TLS \u914d\u7f6e\u4e0e HTTPS \u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-11-04T07:24:46+00:00","dateModified":"2026-11-04T07:24:46+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/122283.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/122283.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/122283.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u7b2c12\u7ae0\uff1aNginx SSL\/TLS \u914d\u7f6e\u4e0e HTTPS \u5b9e\u6218"}]},{"@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\/122283","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=122283"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/122283\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=122283"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=122283"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=122283"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=122283"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}