aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/http/headers/x-forwarded-host
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/http/headers/x-forwarded-host
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/zh-cn/web/http/headers/x-forwarded-host')
-rw-r--r--files/zh-cn/web/http/headers/x-forwarded-host/index.html64
1 files changed, 64 insertions, 0 deletions
diff --git a/files/zh-cn/web/http/headers/x-forwarded-host/index.html b/files/zh-cn/web/http/headers/x-forwarded-host/index.html
new file mode 100644
index 0000000000..22e93c14ca
--- /dev/null
+++ b/files/zh-cn/web/http/headers/x-forwarded-host/index.html
@@ -0,0 +1,64 @@
+---
+title: X-Forwarded-Host
+slug: Web/HTTP/Headers/X-Forwarded-Host
+tags:
+ - 代理
+ - 请求首部
+ - 负载均衡
+ - 超文本传输协议
+ - 转发
+ - 首部
+translation_of: Web/HTTP/Headers/X-Forwarded-Host
+---
+<div>{{HTTPSidebar}}</div>
+
+<p>The <strong><code>X-Forwarded-Host</code></strong> (XFH) 是一个事实上的标准首部,用来确定客户端发起的请求中使用  {{HTTPHeader("Host")}}  指定的初始域名。</p>
+
+<p>反向代理(如负载均衡服务器、CDN等)的域名或端口号可能会与处理请求的源头服务器有所不同,在这种情况下,X-Forwarded-Host 可以用来确定哪一个域名是最初被用来访问的。</p>
+
+<p>这个消息首部会被用来进行调试和统计,以及生成基于位置的定制化内容,按照设计的目的,它会暴露一定的隐私和敏感信息,比如客户端的IP地址。所以在应用此消息首部的时候,需要将用户的隐私问题考虑在内。</p>
+
+<p>HTTP 协议中的  {{HTTPHeader("Forwarded")}}  是这个消息首部的标准化版本。</p>
+
+<table class="properties">
+ <tbody>
+ <tr>
+ <th scope="row">Header type</th>
+ <td>{{Glossary("Request header")}}</td>
+ </tr>
+ <tr>
+ <th scope="row">{{Glossary("Forbidden header name")}}</th>
+ <td>no</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="语法">语法</h2>
+
+<pre class="syntaxbox">X-Forwarded-Host: &lt;host&gt;
+</pre>
+
+<h2 id="指令">指令</h2>
+
+<dl>
+ <dt>&lt;host&gt;</dt>
+ <dd>被转发的服务器的域名。</dd>
+</dl>
+
+<h2 id="示例">示例</h2>
+
+<pre>X-Forwarded-Host: id42.example-cdn.com
+</pre>
+
+<h2 id="规范">规范</h2>
+
+<p>不属于任何一份既有规范。这个消息首部的标准版本是 {{HTTPHeader("Forwarded")}}.</p>
+
+<h2 id="相关内容">相关内容</h2>
+
+<ul>
+ <li>{{HTTPHeader("Host")}}</li>
+ <li>{{HTTPHeader("Forwarded")}}</li>
+ <li>{{HTTPHeader("X-Forwarded-For")}}</li>
+ <li>{{HTTPHeader("X-Forwarded-Proto")}}</li>
+</ul>