From 218934fa2ed1c702a6d3923d2aa2cc6b43c48684 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:43:23 -0500 Subject: initial commit --- .../web/http/headers/x-forwarded-for/index.html | 74 ++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 files/zh-tw/web/http/headers/x-forwarded-for/index.html (limited to 'files/zh-tw/web/http/headers/x-forwarded-for') diff --git a/files/zh-tw/web/http/headers/x-forwarded-for/index.html b/files/zh-tw/web/http/headers/x-forwarded-for/index.html new file mode 100644 index 0000000000..546a4ed60c --- /dev/null +++ b/files/zh-tw/web/http/headers/x-forwarded-for/index.html @@ -0,0 +1,74 @@ +--- +title: X-Forwarded-For +slug: Web/HTTP/Headers/X-Forwarded-For +translation_of: Web/HTTP/Headers/X-Forwarded-For +--- +
{{HTTPSidebar}}
+ +

X-Forwarded-For (XFF) 標頭是辨識用戶端透過 HTTP 代理或負載平衡 IP 位置來源的,事實上的標準。如果流量是在伺服器與用戶端中間擷取,伺服器日誌就只會代理或負載平衡的 IP 位置。如果要檢查用戶端的 IP 的原始來源,就會去檢查 X-Forwarded-For 請求標頭。

+ +

這個標頭用於除錯、分析、產生與位置相關的內容、透過設計也洩漏部分隱私資訊,例如用戶端的 IP 位置。因此在部署此標頭時,必須考慮到用戶的隱私。

+ +

此 HTTP 標頭的標準化版本為 {{HTTPHeader("Forwarded")}} 標頭。

+ +

X-Forwarded-For 也是個說明 email-message 是從哪個帳戶轉發的 email-header。

+ + + + + + + + + + + + +
標頭屬性{{Glossary("Request header")}}
{{Glossary("Forbidden header name")}}no
+ +

語法

+ +
X-Forwarded-For: <client>, <proxy1>, <proxy2>
+
+ +

指令

+ +
+
<client>
+
用戶端的 IP 位置
+
<proxy1>, <proxy2>
+
如果請求用上了多個代理,則列出每個後續代理的 IP 地址。也就是說,最右邊的 IP 位置,是最新代理的 IP 位置;最左邊的 IP 位置,是用戶端原始來源的 IP 位置。
+
+ +

示例

+ +
X-Forwarded-For: 2001:db8:85a3:8d3:1319:8a2e:370:7348
+
+X-Forwarded-For: 203.0.113.195
+
+X-Forwarded-For: 203.0.113.195, 70.41.3.18, 150.172.238.178
+
+ +

其他非標準變體:

+ +
# Used for some Google services
+X-ProxyUser-Ip: 203.0.113.19
+ +

規範

+ +

任何版本都沒有被標準化。標準化版本的標頭為 {{HTTPHeader("Forwarded")}}。

+ +

瀏覽器相容性

+ + + +

{{Compat("http.headers.X-Forwarded-For")}}

+ +

參見

+ + -- cgit v1.2.3-54-g00ecf