{"id":5875,"date":"2022-05-12T14:06:56","date_gmt":"2022-05-12T06:06:56","guid":{"rendered":"http:\/\/123.57.164.21\/?p=5875"},"modified":"2022-05-12T14:06:56","modified_gmt":"2022-05-12T06:06:56","slug":"springboot-%e5%86%85%e7%bd%ae%e7%9a%84tomcat%e6%9c%8d%e5%8a%a1%e5%99%a8%e9%85%8d%e7%bd%ae%e8%af%a6%e8%a7%a3%ef%bc%88%e9%99%84%ef%bc%9a%e5%90%af%e7%94%a8https%e6%9c%8d%e5%8a%a1%ef%bc%89","status":"publish","type":"post","link":"https:\/\/92it.top\/?p=5875","title":{"rendered":"SpringBoot &#8211; \u5185\u7f6e\u7684Tomcat\u670d\u52a1\u5668\u914d\u7f6e\u8be6\u89e3\uff08\u9644\uff1a\u542f\u7528HTTPS\u670d\u52a1\uff09"},"content":{"rendered":"\n<p>\u00a0 \u5728 <strong>Spring boot <\/strong>\u9879\u76ee\u4e2d\uff0c\u53ef\u4ee5\u5185\u7f6e <strong>Tomcat<\/strong>\u3001<strong>Jetty<\/strong>\u3001<strong>Undertow<\/strong>\u3001<strong>Netty<\/strong> \u7b49\u670d\u52a1\u5668\u5bb9\u5668\u3002\u5f53\u6211\u4eec\u6dfb\u52a0\u4e86<strong> spring-boot-starter-web<\/strong> \u4f9d\u8d56\u540e\uff0c\u9ed8\u8ba4\u4f1a\u4f7f\u7528 <strong>Tomcat<\/strong> \u4f5c\u4e3a <strong>Web<\/strong> \u5bb9\u5668\u3002 \u00a0 \u00a0 <\/p>\n\n\n\n<p>\u4e0b\u9762\u6f14\u793a\u5982\u4f55\u5bf9\u8fd9\u4e2a <strong>Tomcat<\/strong> \u8fdb\u884c\u8fdb\u4e00\u6b65\u7684\u914d\u7f6e\u3002<\/p>\n\n\n\n<p><strong>1\uff0c\u5e38\u89c4\u914d\u7f6e<\/strong><\/p>\n\n\n\n<p>\uff081\uff09\u8981\u5bf9 <strong>Tomcat<\/strong> \u8fdb\u884c\u8fdb\u4e00\u6b65\u7684\u914d\u7f6e\uff0c\u53ef\u4ee5\u5728\u00a0<strong>application.properties <\/strong>\u4e2d\u8fdb\u884c\u914d\u7f6e\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-84.png\" alt=\"\" class=\"wp-image-5876\" width=\"423\" height=\"432\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-84.png 668w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-84-294x300.png 294w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-84-230x235.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-84-350x357.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-84-480x490.png 480w\" sizes=\"(max-width: 423px) 100vw, 423px\" \/><\/figure><\/div>\n\n\n\n<p>\uff082\uff09\u4e0b\u9762\u6211\u4eec\u4fee\u6539\u4e00\u4e9b\u5e38\u7528\u7684\u914d\u7f6e\uff0c\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n\n\n\n<p>\u914d\u7f6e\u8bf4\u660e\uff1a<\/p>\n\n\n\n<ul><li>server.port\uff1a\u914d\u7f6e Web \u5bb9\u5668\u7684\u7aef\u53e3\u53f7\uff08\u9ed8\u8ba4\u4e3a 8080\uff09<\/li><li>server.error.path\uff1a\u914d\u7f6e\u5f53\u524d\u9879\u76ee\u51fa\u9519\u65f6\u8df3\u8f6c\u53bb\u7684\u9875\u9762\u3002<\/li><li>server.servlet.session.timeout\uff1a\u914d\u7f6e session \u5931\u6548\u65f6\u95f4\u300230m \u8868\u793a 30 \u5206\u949f\uff0c\u5982\u679c\u4e0d\u5199\u5355\u4f4d\u5219\u9ed8\u8ba4\u5355\u4f4d\u662f\u79d2\u3002\uff08\u6ce8\u610f\uff1a\u7531\u4e8e Tomcat \u4e2d\u914d\u7f6e session \u8fc7\u671f\u65f6\u95f4\u662f\u4ee5\u5206\u949f\u4e3a\u5355\u4f4d\uff0c\u5982\u679c\u6211\u4eec\u8fd9\u91cc\u8bbe\u7f6e\u662f\u79d2\u7684\u8bdd\uff0c\u90a3\u4e48\u4f1a\u81ea\u52a8\u8f6c\u6362\u4e3a\u4e00\u4e2a\u4e0d\u8d85\u8fc7\u6240\u914d\u7f6e\u79d2\u6570\u7684\u6700\u5927\u5206\u949f\u6570\u3002\u6bd4\u5982\u914d\u7f6e\u4e86 119 \u79d2\uff0c\u90a3\u4e48\u5b9e\u9645 session \u8fc7\u671f\u65f6\u95f4\u662f 1 \u5206\u949f\uff09<\/li><li>server.servlet.context-path\uff1a\u914d\u7f6e\u9879\u76ee\u540d\u79f0\uff08\u9ed8\u8ba4\u4e3a \/\uff09\uff0c\u5982\u679c\u914d\u7f6e\u4e86\u9879\u76ee\u540d\u79f0\uff0c\u90a3\u4e48\u5728\u8bbf\u95ee\u8def\u5f84\u4e2d\u8981\u52a0\u4e0a\u914d\u7f6e\u7684\u8def\u5f84<\/li><li>server.tomcat.uri-encoding\uff1a\u914d\u7f6e Tomcat \u8bf7\u6c42\u7f16\u7801<\/li><li>server.tomcat.max-threads\uff1a\u914d\u7f6e Tomcat \u7684\u6700\u5927\u7ebf\u7a0b\u6570<\/li><li>server.tomcat.basedir\uff1a\u914d\u7f6e Tomcat \u8fd0\u884c\u65e5\u5fd7\u548c\u4e34\u65f6\u6587\u4ef6\u7684\u76ee\u5f55\u3002\u82e5\u4e0d\u914d\u7f6e\uff0c\u5219\u9ed8\u8ba4\u4f7f\u7528\u7cfb\u7edf\u7684\u4e34\u65f6\u76ee\u5f55\u3002<\/li><\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">server.port=8081\nserver.error.path=\/error\nserver.servlet.session.timeout=30m\nserver.servlet.context-path=\/hangge\nserver.tomcat.uri-encoding=utf-8\nserver.tomcat.max-threads=500\nserver.tomcat.basedir=\/home\/hangge\/tmp<\/pre>\n\n\n\n<p>\uff083\uff09\u91cd\u542f\u540e\uff0c\u7531\u4e8e\u6211\u4eec\u914d\u7f6e\u4e86 <strong>hangge<\/strong> \u8fd9\u4e2a\u9879\u76ee\u540d\u79f0\uff0c\u56e0\u6b64\u9700\u8981\u901a\u8fc7\u5982\u4e0b\u5730\u5740\u8bbf\u95ee <strong>\/hello <\/strong>\u8fd9\u4e2a\u63a5\u53e3\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-85.png\" alt=\"\" class=\"wp-image-5877\" width=\"395\" height=\"126\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-85.png 734w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-85-300x96.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-85-230x73.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-85-350x112.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-85-480x153.png 480w\" sizes=\"(max-width: 395px) 100vw, 395px\" \/><\/figure><\/div>\n\n\n\n<p><strong>2\uff0cHTTPS \u914d\u7f6e<\/strong><\/p>\n\n\n\n<p>\u7531\u4e8e HTTPS \u5177\u6709\u826f\u597d\u7684\u5b89\u5168\u6027\uff0c\u5728\u5f00\u53d1\u4e2d\u5f97\u5230\u4e86\u8d8a\u6765\u8d8a\u5e7f\u6cdb\u7684\u5e94\u7528\u3002\u4e0d\u8fc7\u4e00\u4e2a HTTPS \u8bc1\u4e66\u4ef7\u683c\u8fd8\u662f\u6709\u70b9\u8d35\uff0c\u597d\u5728\u56fd\u5185\u4e00\u4e9b\u670d\u52a1\u5668\u5382\u5546\u4e5f\u6709\u63d0\u4f9b\u514d\u8d39\u7684 HTTPS \u8bc1\u4e66\u3002\u4e3a\u65b9\u4fbf\u6f14\u793a\uff0c\u4e0b\u9762\u6211\u76f4\u63a5\u4f7f\u7528 jdk \u63d0\u4f9b\u7684\u7684 Java \u6570\u5b57\u8bc1\u4e66\u7ba1\u7406\u5de5\u5177 keytool \u6765\u751f\u6210\u4e00\u4e2a\u8bc1\u4e66\u3002<\/p>\n\n\n\n<p>\uff081\uff09<strong>jdk<\/strong> \u63d0\u4f9b\u7684\u6570\u5b57\u8bc1\u4e66\u7ba1\u7406\u5de5\u5177 <strong>keytool<\/strong> \u5728<strong> \\jdk\\bin<\/strong> \u76ee\u5f55\u4e0b\u3002\u6211\u4eec\u5728\u7ec8\u7aef\u4e2d\u6267\u884c\u5982\u4e0b\u547d\u4ee4\u81ea\u884c\u751f\u6210\u4e00\u4e2a\u6570\u5b57\u8bc1\u4e66\uff1a<\/p>\n\n\n\n<p>\u547d\u4ee4\u53c2\u6570\u8bf4\u660e\uff1a<\/p>\n\n\n\n<ul><li>-genkey\uff1a\u8868\u793a\u8981\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5bc6\u94a5<\/li><li>-alias\uff1a\u8868\u793a keystore \u7684\u522b\u540d<\/li><li>-keyalg\uff1a\u8868\u793a\u4f7f\u7528\u7684\u52a0\u5bc6\u7b97\u6cd5\u662f RSA\uff08\u4e00\u79cd\u975e\u5bf9\u79f0\u52a0\u5bc6\u7b97\u6cd5\uff09<\/li><li>-keysize\uff1a\u8868\u793a\u5bc6\u94a5\u7684\u957f\u5ea6<\/li><li>-keystore\uff1a\u8868\u793a\u751f\u6210\u7684\u5bc6\u94a5\u5b58\u653e\u4f4d\u7f6e<\/li><li>-validity\uff1a\u8868\u793a\u5bc6\u94a5\u7684\u6709\u6548\u65f6\u95f4\uff08\u5355\u4f4d\u4e3a\u5929\uff09<\/li><\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">keytool -genkey -alias tomcathttps -keyalg RSA -keysize 2048 -keystore hangge.p12 -validity 365<\/pre>\n\n\n\n<p>\uff082\uff09\u4e0a\u8ff0\u547d\u4ee4\u6267\u884c\u8fc7\u7a0b\u4e2d\u4f1a\u8981\u6c42\u8f93\u5165\u5bc6\u94a5\u53e3\u4ee4\u7b49\u4fe1\u606f\uff0c\u6211\u4eec\u6839\u636e\u63d0\u793a\u4e00\u6b65\u6b65\u8f93\u5165\u5373\u53ef\u3002\u6700\u7ec8\u4f1a\u5728\u5f53\u524d\u76ee\u5f55\u4e0b\u751f\u6210\u4e00\u4e2a<strong> hangge.p12<\/strong> \u7684\u6587\u4ef6\uff0c\u6211\u4eec\u5c06\u5176\u590d\u5236\u5230\u9879\u76ee\u7684\u6839\u76ee\u5f55\u4e0b\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-86.png\" alt=\"\" class=\"wp-image-5879\" width=\"400\" height=\"382\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-86.png 682w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-86-300x287.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-86-230x220.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-86-350x335.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-86-480x459.png 480w\" sizes=\"(max-width: 400px) 100vw, 400px\" \/><\/figure><\/div>\n\n\n\n<p>\uff083\uff09\u63a5\u7740\u5728\u9879\u76ee <strong>application.properties<\/strong> \u4e2d\u505a\u5982\u4e0b\u914d\u7f6e\uff1a<\/p>\n\n\n\n<p>\u914d\u7f6e\u8bf4\u660e<strong>\uff1a<\/strong><\/p>\n\n\n\n<ul><li>server.ssl.key-store\uff1a\u8868\u793a\u5bc6\u94a5\u6587\u4ef6\u540d<\/li><li>server.ssl.key-alias\uff1a\u8868\u793a\u5bc6\u94a5\u522b\u540d<\/li><li>server.ssl.key-store-password\uff1a\u5373\u524d\u9762\u521b\u5efa\u8bc1\u4e66\u8fc7\u7a0b\u4e2d\u8f93\u5165\u7684\u5bc6\u7801<\/li><\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">server.ssl.key-store=hangge.p12\nserver.ssl.key-alias=tomcathttps\nserver.ssl.key-store-password=123456<\/pre>\n\n\n\n<p>\uff084\uff09\u914d\u7f6e\u5b8c\u6bd5\u91cd\u542f\u9879\u76ee\uff0c\u8fd9\u6b21\u6211\u4eec\u901a\u8fc7 <strong>https<\/strong> \u5730\u5740\u8fdb\u884c\u8bbf\u95ee\u3002\u7531\u4e8e\u8bc1\u4e66\u662f\u81ea\u5df1\u751f\u6210\u7684\uff0c\u4e0d\u88ab\u6d4f\u89c8\u5668\u8ba4\u53ef\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-87-1024x566.png\" alt=\"\" class=\"wp-image-5880\" width=\"507\" height=\"280\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-87-1024x566.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-87-300x166.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-87-768x425.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-87-830x459.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-87-230x127.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-87-350x194.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-87-480x266.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-87.png 1504w\" sizes=\"(max-width: 507px) 100vw, 507px\" \/><\/figure><\/div>\n\n\n\n<p>\uff085\uff09\u6211\u4eec\u70b9\u201c\u9ad8\u7ea7\u201d\u7ee7\u7eed\u524d\u8fdb\u5373\u53ef\uff0c\u6700\u540e\u8fd0\u884c\u7ed3\u679c\u5982\u4e0b\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-88.png\" alt=\"\" class=\"wp-image-5881\" width=\"505\" height=\"130\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-88.png 982w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-88-300x78.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-88-768x199.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-88-830x215.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-88-230x59.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-88-350x91.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-88-480x124.png 480w\" sizes=\"(max-width: 505px) 100vw, 505px\" \/><\/figure><\/div>\n\n\n\n<p><strong>3\uff0c\u5c06 HTTP \u8bf7\u6c42\u91cd\u5b9a\u5411\u4e3a HTTPS \u8bf7\u6c42<\/strong><\/p>\n\n\n\n<p>\uff081\uff09\u7ecf\u8fc7\u524d\u9762 <strong>HTTPS<\/strong> \u914d\u7f6e\u4ee5\u540e\uff0c\u5982\u679c\u6211\u4eec\u518d\u7528 <strong>HTTP<\/strong> \u7684\u65b9\u5f0f\u8bbf\u95ee\u63a5\u53e3\uff0c\u4f1a\u53d1\u73b0\u8bbf\u95ee\u5931\u8d25\u3002\u8fd9\u662f\u56e0\u4e3a <strong>Spring Boot <\/strong>\u4e0d\u652f\u6301\u540c\u65f6\u5728\u914d\u7f6e\u4e2d\u542f\u52a8 <strong>HTTP<\/strong> \u548c <strong>HTTPS<\/strong>\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-89.png\" alt=\"\" class=\"wp-image-5882\" width=\"496\" height=\"156\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-89.png 816w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-89-300x94.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-89-768x241.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-89-230x72.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-89-350x110.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-89-480x151.png 480w\" sizes=\"(max-width: 496px) 100vw, 496px\" \/><\/figure><\/div>\n\n\n\n<p>\uff082\uff09\u6211\u4eec\u53ef\u4ee5\u5728\u9879\u76ee\u4e2d\u521b\u5efa\u4e00\u4e2a\u914d\u7f6e\u7c7b\uff08<strong>TomcatConfig<\/strong>\uff09\u6765\u5b9e\u73b0\u81ea\u52a8\u91cd\u5b9a\u5411\uff1a<\/p>\n\n\n\n<p>\u4ee3\u7801\u8bf4\u660e\uff1a\u6211\u4eec\u9996\u5148\u914d\u7f6e\u4e00\u4e2a TomcatServletWebServerFactory\uff0c\u7136\u540e\u6dfb\u52a0\u4e00\u4e2a Tomcat \u4e2d\u7684 Connector\uff08\u76d1\u542c 80 \u7aef\u53e3\uff09\uff0c\u5e76\u5c06\u8bf7\u6c42\u8f6c\u53d1\u5230 8080 \u4e0a\u53bb\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">package com.example.demo;\n \nimport org.apache.catalina.Context;\nimport org.apache.catalina.connector.Connector;\nimport org.apache.tomcat.util.descriptor.web.SecurityCollection;\nimport org.apache.tomcat.util.descriptor.web.SecurityConstraint;\nimport org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\n \n@Configuration\npublic class TomcatConfig {\n    @Bean\n    TomcatServletWebServerFactory tomcatServletWebServerFactory() {\n        TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory(){\n            @Override\n            protected void postProcessContext(Context context) {\n                SecurityConstraint constraint = new SecurityConstraint();\n                constraint.setUserConstraint(\"CONFIDENTIAL\");\n                SecurityCollection collection = new SecurityCollection();\n                collection.addPattern(\"\/*\");\n                constraint.addCollection(collection);\n                context.addConstraint(constraint);\n            }\n        };\n        factory.addAdditionalTomcatConnectors(createTomcatConnector());\n        return factory;\n    }\n    private Connector createTomcatConnector() {\n        Connector connector = new Connector(\"org.apache.coyote.http11.Http11NioProtocol\");\n        connector.setScheme(\"http\");\n        connector.setPort(80);\n        connector.setSecure(false);\n        connector.setRedirectPort(8080);\n        return connector;\n    }\n}<\/pre>\n\n\n\n<p>\uff083\uff09\u914d\u7f6e\u5b8c\u6210\u540e\uff0c\u6211\u4eec\u5728\u6d4f\u89c8\u5668\u4e0a\u8f93\u5165 \u201c<strong>http:\/\/localhost:80\/hello<\/strong>\u201d \u5c31\u4f1a\u81ea\u52a8\u91cd\u5b9a\u5411\u5230\u201c<strong>https:\/\/localhost:8080\/hello<\/strong>\u201d<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0 \u5728 Spring boot \u9879\u76ee\u4e2d\uff0c\u53ef\u4ee5\u5185\u7f6e Tomcat\u3001Jetty\u3001Undertow\u3001Netty \u7b49\u670d [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27],"tags":[],"_links":{"self":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/5875"}],"collection":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5875"}],"version-history":[{"count":2,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/5875\/revisions"}],"predecessor-version":[{"id":5883,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/5875\/revisions\/5883"}],"wp:attachment":[{"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5875"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5875"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5875"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}