{"id":6213,"date":"2024-08-01T22:46:17","date_gmt":"2024-08-01T14:46:17","guid":{"rendered":"https:\/\/xinchewhd.com.cn\/?p=6213"},"modified":"2024-08-02T14:46:18","modified_gmt":"2024-08-02T06:46:18","slug":"nginx%e8%bf%99%e4%b8%aa%e4%bf%a1%e6%81%af%e6%9a%b4%e9%9c%b2%ef%bc%8c%e6%97%a0%e5%bc%82%e4%ba%8e%e5%90%91%e6%94%bb%e5%87%bb%e8%80%85%e6%98%8e%e7%89%8c","status":"publish","type":"post","link":"https:\/\/xinchewhd.com.cn\/index.php\/nginx\/nginx%e8%bf%99%e4%b8%aa%e4%bf%a1%e6%81%af%e6%9a%b4%e9%9c%b2%ef%bc%8c%e6%97%a0%e5%bc%82%e4%ba%8e%e5%90%91%e6%94%bb%e5%87%bb%e8%80%85%e6%98%8e%e7%89%8c\/","title":{"rendered":"Nginx\u8fd9\u4e2a\u4fe1\u606f\u66b4\u9732\uff0c\u65e0\u5f02\u4e8e\u5411\u653b\u51fb\u8005\u660e\u724c"},"content":{"rendered":"<div class=\"wxsyncmain\">\n<section draggable=\"false\" data-mtitle=\"\u5f15\u5bfc\u5173\u6ce8,\u84dd\u8272,GIF,\u52a8\u6001,\u4e16\u754c\u8bfb\u4e66\u65e5,\u9605\u8bfb\u8ba1\u5212,\u8bfb\u4e66,\u77e5\u8bc6,\u4e66\u7c4d,\u6559\u80b2,\u5386\u53f2\u6587\u5316\" data-mid=\"59885\">\n<section style=\"display: flex; justify-content: flex-start; align-items: flex-start;\">\n<section style=\"display: flex; align-items: center; margin: 4px 0 0;\">\n<section style=\"font-size: 0; width: 5px; height: 29px; background-color: #fed66e;\"><\/section>\n<section style=\"padding: 7px 4px; background-color: #7cbbf2; margin: 0 5px 0 3px;\">\u70b9\u51fb\u4e0a\u65b9<\/p>\n<\/section>\n<section>\u84dd\u5b57\u00b7\u5173\u6ce8\u6211\u4eec<\/p>\n<\/section>\n<\/section>\n<section style=\"width: 28px;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" style=\"width: 100%; max-width: 100%; display: block; height: auto !important;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801223947579.gif\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-ratio=\"1.002\" data-w=\"500\" \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" style=\"width: 100%; max-width: 100%; display: block; height: auto !important;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801223947579.gif\" data-ratio=\"1.002\" data-w=\"500\" \/><\/noscript><\/section>\n<\/section>\n<\/section>\n<section class=\"mp_profile_iframe_wrp\"><\/section>\n<section><\/section>\n<p><span style=\"font-size: 14px;\">\u5728\u7f51\u7edc\u5b89\u5168\u9886\u57df\uff0c\u670d\u52a1\u5668\u4fe1\u606f\u7684\u66b4\u9732\u5e38\u5e38\u88ab\u89c6\u4e3a\u4e00\u79cd\u6f5c\u5728\u7684\u98ce\u9669\u3002\u5177\u4f53\u6765\u8bf4\uff0cNginx\u670d\u52a1\u5668\u7684\u7248\u672c\u53f7\u66b4\u9732\u65e0\u5f02\u4e8e\u5411\u653b\u51fb\u8005\u660e\u724c\uff0c\u589e\u52a0\u4e86\u88ab\u9488\u5bf9\u6027\u653b\u51fb\u7684\u98ce\u9669\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u5982\u4f55\u51cf\u5c11\u670d\u52a1\u5668\u4fe1\u606f\u7684\u6cc4\u9732\uff0c\u5e76\u8fdb\u4e00\u6b65\u589e\u5f3a\u670d\u52a1\u5668\u7684\u9690\u853d\u6027\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u4e00\u79cd\u6bd4\u5173\u95edserver_tokens\u66f4\u7075\u6d3b\u3001\u66f4\u9690\u853d\u7684\u65b9\u6cd5\u3002<\/span><\/p>\n<section style=\"margin-bottom: 0px; letter-spacing: 0.578px; text-wrap: wrap; text-indent: 2em;\"><\/section>\n<section style=\"margin-bottom: 0px; letter-spacing: 0.578px; text-wrap: wrap;\" draggable=\"false\" data-mtitle=\"\u4e3b\u526f\u6807\u9898,\u6570\u5b57,\u7f16\u53f7,\u7b80\u7ea6,\u84dd\u8272,\u7bad\u5934,\u56fd\u9645\u7231\u8033\u65e5,\u517b\u751f\u5065\u5eb7,\u5065\u5eb7\u79d1\u666e,\u533b\u7597\u533b\u836f,\u8033\u6735\" data-mid=\"59204\" data-tools-id=\"81941\">\n<section style=\"display: flex; justify-content: center;\">\n<section style=\"display: flex; flex-direction: column; align-items: center;\">\n<section style=\"margin-bottom: -5px; width: 34px; height: 34px; background-color: #7bbdfd; border-radius: 50%; display: flex; justify-content: center; align-items: center; z-index: 1;\">\n<section>01<\/section>\n<\/section>\n<section style=\"padding: 10px 30px; background-color: #f5fbff;\">\u66b4\u9732\u7248\u672c\u53f7\u7684\u5371\u5bb3<\/p>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"margin-bottom: 0px; letter-spacing: 0.578px; text-indent: 0em; text-wrap: wrap;\"><\/section>\n<p style=\"margin-bottom: 0px; letter-spacing: 0.578px; text-wrap: wrap; text-indent: 2em;\"><span style=\"font-size: 14px;\">\u6709\u65f6\u5019\u6211\u4eec\u53ef\u80fd\u4f1a\u8d28\u7591\uff0c\u6cc4\u9732nginx\u7684\u7248\u672c\u53f7\u6709\u4ec0\u4e48\u5927\u4e0d\u4e86\uff1f\u4f46\u5b9e\u9645\u4e0a\u4e3b\u8981\u901a\u8fc7\u6076\u610f\u6784\u9020\u7684\u8bf7\u6c42\u5c31\u80fd\u4ea7\u751f\u81f4\u547d\u7684\u5a01\u80c1\uff0c\u5982 1.15.6 \u548c 1.14.1 \u7248\u672c\u4e4b\u524d\u7684 nginx \u5728 HTTP\/2 \u5b9e\u73b0\u4e2d\u5b58\u5728\u6f0f\u6d1e\uff0c\u6784\u9020\u4e4b\u540e\u7684\u8bf7\u6c42\u5c31\u53ef\u80fd\u5bfc\u81f4nginx\u5185\u5b58\u6d88\u8017\u8fc7\u5927\uff0c\u4e25\u91cd\u8005\u51fa\u73b0\u62d2\u7edd\u670d\u52a1\uff08Dos\uff09\u3002<\/span><\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801223953428.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-galleryid=\"\" data-imgfileid=\"100000299\" data-ratio=\"0.15892420537897312\" data-s=\"300,640\" data-type=\"png\" data-w=\"818\" \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801223953428.png\" data-galleryid=\"\" data-imgfileid=\"100000299\" data-ratio=\"0.15892420537897312\" data-s=\"300,640\" data-type=\"png\" data-w=\"818\" \/><\/noscript><\/p>\n<section style=\"text-indent: 2em;\"><\/section>\n<section draggable=\"false\" data-mtitle=\"\u4e3b\u526f\u6807\u9898,\u6570\u5b57,\u7f16\u53f7,\u7b80\u7ea6,\u84dd\u8272,\u7bad\u5934,\u56fd\u9645\u7231\u8033\u65e5,\u517b\u751f\u5065\u5eb7,\u5065\u5eb7\u79d1\u666e,\u533b\u7597\u533b\u836f,\u8033\u6735\" data-mid=\"59204\" data-tools-id=\"81941\">\n<section style=\"display: flex; justify-content: center;\">\n<section style=\"display: flex; flex-direction: column; align-items: center;\">\n<section style=\"width: 34px; height: 34px; background-color: #7bbdfd; border-radius: 50%; display: flex; justify-content: center; align-items: center; margin-bottom: -5px; z-index: 1;\">\n<section>02<\/section>\n<\/section>\n<section style=\"background-color: #f5fbff; padding: 10px 30px;\">\u5927\u578b\u7f51\u7ad9\u7684\u505a\u6cd5<\/p>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"text-indent: 0em;\"><\/section>\n<section style=\"text-indent: 0em;\"><span style=\"font-size: 14px; text-indent: 0em; letter-spacing: 0.034em;\">\u5927\u578b\u7684\u7f51\u7ad9\u57fa\u672c\u4f1a\u9690\u85cf\u7248\u672c\u53f7\uff0c\u66f4\u6709\u751a\u8005\u4f1a\u81ea\u5b9a\u4e49web\u5f15\u64ce\u7684\u540d\u79f0\uff0c\u6211\u4eec\u5148\u770b\u4e0b\u5929\u732b\u548c\u4eac\u4e1c\u7684\u505a\u6cd5\u3002<\/span><\/section>\n<section style=\"text-indent: 0em;\"><strong><span style=\"font-size: 14px;\">\u5929\u732b\uff1a<\/span><\/strong><\/section>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224102499.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-galleryid=\"\" data-imgfileid=\"100000296\" data-ratio=\"0.3088942307692308\" data-s=\"300,640\" data-type=\"png\" data-w=\"832\" \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224102499.png\" data-galleryid=\"\" data-imgfileid=\"100000296\" data-ratio=\"0.3088942307692308\" data-s=\"300,640\" data-type=\"png\" data-w=\"832\" \/><\/noscript><\/p>\n<section style=\"text-indent: 2em;\"><\/section>\n<p><strong><span style=\"font-size: 14px;\">\u4eac\u4e1c\uff1a<\/span><\/strong><\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224106337.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-galleryid=\"\" data-imgfileid=\"100000298\" data-ratio=\"0.3573407202216066\" data-s=\"300,640\" data-type=\"png\" data-w=\"722\" \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224106337.png\" data-galleryid=\"\" data-imgfileid=\"100000298\" data-ratio=\"0.3573407202216066\" data-s=\"300,640\" data-type=\"png\" data-w=\"722\" \/><\/noscript><\/p>\n<p><span style=\"font-size: 14px;\">\u4ece\u4e0a\u9762\u7684\u622a\u56fe\uff0c\u6211\u4eec\u53ef\u4ee5\u770b\u51fa\uff0c\u6ca1\u6709\u4e00\u5bb6\u662f\u663e\u793aweb\u5f15\u64ce\u7684\u7248\u672c\u53f7\u7684\u3002<\/span><\/p>\n<section draggable=\"false\" data-mtitle=\"\u4e3b\u526f\u6807\u9898,\u6570\u5b57,\u7f16\u53f7,\u7b80\u7ea6,\u84dd\u8272,\u7bad\u5934,\u56fd\u9645\u7231\u8033\u65e5,\u517b\u751f\u5065\u5eb7,\u5065\u5eb7\u79d1\u666e,\u533b\u7597\u533b\u836f,\u8033\u6735\" data-mid=\"59204\" data-tools-id=\"69932\">\n<section style=\"display: flex; justify-content: center;\">\n<section style=\"display: flex; flex-direction: column; align-items: center;\">\n<section style=\"width: 34px; height: 34px; background-color: #7bbdfd; border-radius: 50%; display: flex; justify-content: center; align-items: center; margin-bottom: -5px; z-index: 1;\">\n<section>03<\/section>\n<\/section>\n<section style=\"background-color: #f5fbff; padding: 10px 30px;\">\u5b9e\u7528\u65b9\u6cd5\u4ecb\u7ecd<\/p>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"text-indent: 2em;\"><span style=\"font-size: 14px;\"><span style=\"color: #24292f; font-family: 'Noto Sans';\">\u5728\u4e0a\u9762\u6587\u7ae0\u4e2d\uff0c\u6211\u4eec\u5df2\u7ecf\u4ecb\u7ecd\u4e86nginx\u7684\u7f16\u8bd1\u65b9\u6cd5\uff0c\u5176\u4e2d\u5c31\u5305\u542b\u4e86<\/span><span style=\"font-size: 14px; font-family: 'Noto Sans'; color: #000000; background-color: #fffb00;\"><strong><span style=\"color: #000000; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-style: italic; letter-spacing: 0.578px; text-align: left; white-space-collapse: preserve;\">headers-more-nginx-module<\/span><\/strong><\/span><span style=\"text-indent: 2em; letter-spacing: 0.034em;\">\u6a21\u5757\uff0c\u5176\u4e2d\u6709\u4e2a\u6307\u4ee4<\/span><span style=\"text-indent: 2em; letter-spacing: 0.034em; background-color: #fffb00;\">more_set_headers<\/span><span style=\"text-indent: 2em; letter-spacing: 0.034em;\">\u53ef\u4ee5\u5b9e\u73b0\u7075\u6d3b\u9690\u85cfweb\u5f15\u64ce\u7248\u672c\u53f7\uff0c\u5018\u82e5\u516c\u53f8\u7684\u5b89\u5168\u9632\u62a4\u7b49\u7ea7\u964d\u4f4e\uff0c\u751a\u81f3\u53ef\u4ee5\u81ea\u5b9a\u4e49\u540d\u79f0\uff0c\u4e0b\u9762\u662f\u5b9e\u73b0\u7684\u65b9\u6cd5\uff1a<\/span><\/span><\/section>\n<section style=\"text-indent: 2em;\">\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"nginx\"><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__comment\">#\u5728http\u5757\u4e2d\u6dfb\u52a0\uff0c\u5168\u5c40\u751f\u6548<\/span><\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__section\">\nhttp<\/span> {<\/span><\/code><code><span class=\"code-snippet_outer\">\n    <span class=\"code-snippet__attribute\">more_set_headers<\/span> <span class=\"code-snippet__string\">'Server: SRE'<\/span>;<\/span><\/code><code><span class=\"code-snippet_outer\">\n}<\/span><\/code><code><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__comment\">\n#\u5728server\u5757\u4e2d\u6dfb\u52a0\uff0c\u5c40\u90e8\u751f\u6548\uff0c\u66f4\u52a0\u7075\u6d3b<\/span><\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__section\">\nserver<\/span>{<\/span><\/code><code><span class=\"code-snippet_outer\">\n    <span class=\"code-snippet__attribute\">more_set_headers<\/span> <span class=\"code-snippet__string\">'Server: SRE'<\/span>;<\/span><\/code><code><span class=\"code-snippet_outer\">\n}<\/span><\/code><\/pre>\n<\/section>\n<\/section>\n<section style=\"text-indent: 2em;\"><span style=\"font-size: 14px;\">\u901a\u8fc7\u4e0a\u9762\u7684\u914d\u7f6e\u540e\uff0c\u7ad9\u70b9\u53cd\u9988\u7684response headers\u7684server\u5934\u5c06\u8fd4\u56de\u503c\u4e3aSRE\uff0c\u9ed1\u5ba2\u7684\u653b\u51fb\u6210\u672c\u5c06\u5927\u5927\u63d0\u9ad8\u3002<\/span><\/section>\n<section style=\"text-indent: 2em;\"><span style=\"font-size: 14px;\">\u5f53\u7136\uff0c<\/span><span style=\"font-size: 14px; letter-spacing: 0.578px; text-indent: 34px; text-wrap: wrap; font-family: 'Noto Sans'; color: #000000; background-color: #fffb00;\"><strong><span style=\"font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-style: italic; letter-spacing: 0.578px; text-align: left; white-space-collapse: preserve;\">headers-more-nginx-module<\/span><\/strong><\/span><span style=\"font-size: 14px; text-wrap: wrap; text-indent: 2em; letter-spacing: 0.034em;\">\u6a21\u5757<\/span><span style=\"letter-spacing: 0.476px; text-indent: 28px; text-wrap: wrap; font-size: 14px;\">\u8fd8\u6709\u5176\u4ed6\u5b9e\u7528\u7684\u6307\u4ee4\uff0c\u90fd\u770b\u4e00\u4e0b\u5427\uff1a<\/span><\/section>\n<section style=\"text-indent: 0em;\"><span style=\"letter-spacing: 0.476px; text-indent: 28px; text-wrap: wrap; font-size: 14px;\">1.<span style=\"font-weight: var(--base-text-weight-semibold,600); color: #24292f; font-family: 'Noto Sans', 'SF Pro SC', 'SF Pro Text', 'SF Pro Icons', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif; letter-spacing: normal; text-align: left; text-wrap: wrap;\">more_clear_headers<\/span><span style=\"color: #24292f; font-family: 'Noto Sans', 'SF Pro SC', 'SF Pro Text', 'SF Pro Icons', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif; letter-spacing: normal; text-align: left; text-wrap: wrap;\">\uff1a\u7528\u4e8e\u5220\u9664\u6307\u5b9a\u7684HTTP\u5934\u3002<\/span><\/span><\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"nginx\"><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__attribute\">location<\/span> \/ {<\/span><\/code><code><span class=\"code-snippet_outer\">\n    <span class=\"code-snippet__attribute\">more_clear_headers<\/span> <span class=\"code-snippet__string\">'Server'<\/span>;<\/span><\/code><code><span class=\"code-snippet_outer\">\n}<\/span><\/code><\/pre>\n<\/section>\n<section style=\"text-indent: 0em;\"><span style=\"color: #24292f; font-family: 'Noto Sans', 'SF Pro SC', 'SF Pro Text', 'SF Pro Icons', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: normal; text-align: left; text-wrap: wrap;\">\u8fd9\u5c06\u5220\u9664\u54cd\u5e94\u5934\u4e2d\u7684<\/span><code style=\"font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; font-size: 11.9px; padding: 3px 5px; white-space: break-spaces; border-radius: 6px; color: #24292f; letter-spacing: normal; text-align: left;\">Server<\/code><span style=\"color: #24292f; font-family: 'Noto Sans', 'SF Pro SC', 'SF Pro Text', 'SF Pro Icons', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: normal; text-align: left; text-wrap: wrap;\">\u5b57\u6bb5\u3002<\/span><\/section>\n<section style=\"text-indent: 0em;\"><span style=\"font-size: 14px;\">2.<span style=\"font-weight: var(--base-text-weight-semibold,600); color: #24292f; font-family: 'Noto Sans', 'SF Pro SC', 'SF Pro Text', 'SF Pro Icons', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif; letter-spacing: normal; text-align: left; text-wrap: wrap;\">more_set_input_headers<\/span><span style=\"color: #24292f; font-family: 'Noto Sans', 'SF Pro SC', 'SF Pro Text', 'SF Pro Icons', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif; letter-spacing: normal; text-align: left; text-wrap: wrap;\">\uff1a\u7528\u4e8e\u4fee\u6539\u4f20\u5165\u8bf7\u6c42\u7684HTTP\u5934\u3002<\/span><\/span><\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"nginx\"><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__attribute\">location<\/span> \/ {<\/span><\/code><code><span class=\"code-snippet_outer\">\n    <span class=\"code-snippet__attribute\">more_set_input_headers<\/span> <span class=\"code-snippet__string\">'X-Forwarded-Proto: https'<\/span>;<\/span><\/code><code><span class=\"code-snippet_outer\">\n}<\/span><\/code><\/pre>\n<\/section>\n<section style=\"text-indent: 0em;\"><span style=\"color: #24292f; font-family: 'Noto Sans', 'SF Pro SC', 'SF Pro Text', 'SF Pro Icons', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: normal; text-align: left; text-wrap: wrap;\">\u8fd9\u5c06\u4e3a\u6240\u6709\u4f20\u5165\u8bf7\u6c42\u6dfb\u52a0\u6216\u4fee\u6539X-Forwarded-Proto\u5934\u3002<\/span><\/section>\n<section style=\"text-indent: 0em;\"><span style=\"color: #24292f; font-family: 'Noto Sans', 'SF Pro SC', 'SF Pro Text', 'SF Pro Icons', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: normal; text-align: left; text-wrap: wrap;\">3.<span style=\"font-weight: var(--base-text-weight-semibold,600); color: #24292f; font-family: 'Noto Sans', 'SF Pro SC', 'SF Pro Text', 'SF Pro Icons', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif; letter-spacing: normal; text-align: left; text-wrap: wrap;\">more_clear_input_headers<\/span><span style=\"color: #24292f; font-family: 'Noto Sans', 'SF Pro SC', 'SF Pro Text', 'SF Pro Icons', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif; letter-spacing: normal; text-align: left; text-wrap: wrap;\">\uff1a\u7528\u4e8e\u5220\u9664\u4f20\u5165\u8bf7\u6c42\u7684\u6307\u5b9aHTTP\u5934\u3002<\/span><\/span><\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"nginx\"><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__attribute\">location<\/span> \/ {<\/span><\/code><code><span class=\"code-snippet_outer\">\n    <span class=\"code-snippet__attribute\">more_clear_input_headers<\/span> <span class=\"code-snippet__string\">'User-Agent'<\/span>;<\/span><\/code><code><span class=\"code-snippet_outer\">\n}<\/span><\/code><\/pre>\n<\/section>\n<section style=\"text-indent: 0em;\"><span style=\"color: #24292f; font-family: 'Noto Sans', 'SF Pro SC', 'SF Pro Text', 'SF Pro Icons', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: normal; text-align: left; text-wrap: wrap;\">\u8fd9\u5c06\u5220\u9664\u4f20\u5165\u8bf7\u6c42\u4e2d\u7684User-Agent\u5934\u3002<\/span><\/section>\n<section style=\"text-indent: 0em;\"><\/section>\n<section style=\"margin-bottom: 0px; letter-spacing: 0.578px; text-wrap: wrap;\" draggable=\"false\" data-mtitle=\"\u4e3b\u526f\u6807\u9898,\u6570\u5b57,\u7f16\u53f7,\u7b80\u7ea6,\u84dd\u8272,\u7bad\u5934,\u56fd\u9645\u7231\u8033\u65e5,\u517b\u751f\u5065\u5eb7,\u5065\u5eb7\u79d1\u666e,\u533b\u7597\u533b\u836f,\u8033\u6735\" data-mid=\"59204\" data-tools-id=\"15985\">\n<section style=\"display: flex; justify-content: center;\">\n<section style=\"display: flex; flex-direction: column; align-items: center;\">\n<section style=\"margin-bottom: -5px; width: 34px; height: 34px; background-color: #7bbdfd; border-radius: 50%; display: flex; justify-content: center; align-items: center; z-index: 1;\">\n<section>04<\/section>\n<\/section>\n<section style=\"padding: 10px 30px; background-color: #f5fbff;\">\u7ed3 \u8bed<\/p>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<p style=\"margin-bottom: 0px; letter-spacing: 0.578px; text-wrap: wrap; text-indent: 2em;\">\n<section style=\"text-indent: 2em;\"><span style=\"font-size: 14px;\">\u901a\u8fc7\u5408\u7406\u914d\u7f6eNginx\u7684server_tokens\u6307\u4ee4\u548c\u4f7f\u7528more_set_headers\u6a21\u5757\uff0c\u6211\u4eec\u53ef\u4ee5\u6709\u6548\u9690\u85cfNginx\u7248\u672c\u53f7\uff0c\u5e76\u8fdb\u4e00\u6b65\u4f2a\u88c5\u670d\u52a1\u5668\u4fe1\u606f\u3002\u8fd9\u4e0d\u4ec5\u63d0\u5347\u4e86\u670d\u52a1\u5668\u7684\u9690\u853d\u6027\uff0c\u4e5f\u589e\u52a0\u4e86\u653b\u51fb\u8005\u8bc6\u522b\u548c\u653b\u51fb\u7684\u96be\u5ea6\uff0c\u4ece\u800c\u63d0\u9ad8\u4e86\u6574\u4f53\u5b89\u5168\u6027\u3002\u6b64\u5916\uff0c\u6211\u4eec\u5f80\u5f80\u53ef\u80fd\u8ba4\u4e3anginx\u7684\u5b89\u88c5\u5f88\u7b80\u5355\uff0c\u4f46\u8981\u6784\u5efa\u4e00\u5957\u80fd\u6297\u80fd\u6253\u7684nginx\u8fd8\u662f\u9700\u8981\u6709\u5b9e\u7528\u7684\u63d2\u4ef6\u52a0\u6301\uff0c\u6b22\u8fce\u9605\u8bfb\u4e0a\u4e00\u7bc7\u6587\u7ae0\uff0c\u4e0b\u671f\u5c06\u7ee7\u7eed\u4e3a\u5927\u5bb6\u5206\u4eabnginx\u7684\u5b9e\u7528\u6a21\u5757\u7684\u5177\u4f53\u5b9e\u6218\u3002<\/span><\/section>\n<blockquote class=\"js_blockquote_wrap\" data-type=\"2\" data-url=\"\" data-author-name=\"\" data-content-utf8-length=\"41\" data-source-title=\"\" data-text=\"\u6b22\u8fce\u8ba2\u9605\u6211\u7684\u516c\u4f17\u53f7\u300cSRE\u8fd0\u7ef4\u624b\u8bb0\u300d\uff0c\u53ef\u626b\u4e0b\u65b9\u4e8c\u7ef4\u7801\uff0c\u6216\u8005\u5fae\u4fe1\u641c\u201cSRE\u8fd0\u7ef4\u624b\u8bb0\u201d\" data-editid=\"93i1r11cuiv8ux4ix34\">\n<section class=\"js_blockquote_digest\">\n<section><span style=\"color: #000000;\">\u6b22\u8fce\u8ba2\u9605\u6211\u7684\u516c\u4f17\u53f7\u300cSRE\u8fd0\u7ef4\u624b\u8bb0\u300d\uff0c\u53ef\u626b\u4e0b\u65b9\u4e8c\u7ef4\u7801\uff0c\u6216\u8005\u5fae\u4fe1\u641c\u201cSRE\u8fd0\u7ef4\u624b\u8bb0\u201d<\/span><\/section>\n<\/section>\n<\/blockquote>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"rich_pages wxw-img js_insertlocalimg lazyload\" style=\"height: auto !important;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224109102.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-imgfileid=\"100000217\" data-ratio=\"0.3425925925925926\" data-s=\"300,640\" data-type=\"png\" data-w=\"1080\" \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img js_insertlocalimg\" style=\"height: auto !important;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224109102.png\" data-imgfileid=\"100000217\" data-ratio=\"0.3425925925925926\" data-s=\"300,640\" data-type=\"png\" data-w=\"1080\" \/><\/noscript><\/p>\n<p style=\"display: none;\">\n<blockquote><p>\u672c\u7bc7\u6587\u7ae0\u6765\u6e90\u4e8e\u5fae\u4fe1\u516c\u4f17\u53f7: SRE\u8fd0\u7ef4\u624b\u8bb0<\/p><\/blockquote>\n<\/div>\n","raw":"","protected":false},"excerpt":{"rendered":"<p>\u70b9\u51fb\u4e0a\u65b9 \u84dd\u5b57\u00b7\u5173\u6ce8\u6211\u4eec \u5728\u7f51\u7edc\u5b89\u5168\u9886\u57df\uff0c\u670d\u52a1\u5668\u4fe1\u606f\u7684\u66b4\u9732\u5e38\u5e38\u88ab\u89c6\u4e3a\u4e00\u79cd\u6f5c\u5728\u7684\u98ce\u9669\u3002\u5177\u4f53\u6765\u8bf4\uff0cNginx\u670d\u52a1\u5668\u7684\u7248\u672c\u53f7\u66b4\u9732\u65e0\u5f02\u4e8e\u5411 &#8230;<\/p>\n","protected":false},"author":1,"featured_media":6158,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[5],"tags":[],"class_list":["post-6213","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-nginx"],"post_thumbnail_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801223937431-150x150.jpeg","content_first_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801223947579.gif","post_medium_image_300":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801223937431-300x128.jpeg","post_thumbnail_image_624":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801223937431.jpeg","post_frist_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801223947579.gif","post_medium_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801223937431-300x128.jpeg","post_large_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801223937431.jpeg","post_full_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801223937431.jpeg","post_all_images":[{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801223947579.gif","id":"image0"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801223947579.gif","id":"image1"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801223953428.png","id":"image2"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801223953428.png","id":"image3"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224102499.png","id":"image4"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224102499.png","id":"image5"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224106337.png","id":"image6"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224106337.png","id":"image7"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224109102.png","id":"image8"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801224109102.png","id":"image9"}],"videoAdId":"","listAd":"0","listAdId":"","listAdEvery":6,"total_comments":0,"category_name":"Nginx","post_date":"2024-08-01","like_count":"0","praiseWord":"\u9f13\u52b1","copyright_state":"","excitationAd":"0","rewardedVideoAdId":"","detailAdId":"","detailAd":"0","enterpriseMinapp":"0","audios":[],"postImageUrl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230519082947553.jpg","avatarurls":[],"related_posts":null,"pageviews":699,"next_post_id":5574,"next_post_title":"\u8ba1\u7b97\u673a\u57fa\u7840\u7b80\u4ecb\u4e4b\u4e09","previous_post_id":3068,"previous_post_title":"nginx remote_address\u63a7\u5236\u8bbf\u95ee\u5730\u5740","_links":{"self":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/6213","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/comments?post=6213"}],"version-history":[{"count":2,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/6213\/revisions"}],"predecessor-version":[{"id":6370,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/6213\/revisions\/6370"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media\/6158"}],"wp:attachment":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media?parent=6213"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/categories?post=6213"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/tags?post=6213"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}