Generally speaking, X-Forwarded-For是用于记录代理信息的,每经过一级代理(匿名代理除外),代理服务器都会把这次请求的来源IP追加在X-Forwarded-For中
A request from 4.4.4.4, the header contains such a line
X-Forwarded-For: 1.1.1.1, 2.2.2.2, 3.3.3.3
means that the request is sent by 1.1.1.1 and passes through three layers of proxies. The first layer is 2.2.2.2 and the second layer is 3.3.3.3 , and the source IP of this request1.1.1.1发出,经过三层代理,第一层是2.2.2.2,第二层是3.3.3.3,而本次请求的来源IP4.4.4.4 is the third layer proxy
AndX-Real-IP,没有相关标准,上面的例子,如果配置了X-Read-IP, there may be two situations
Generally speaking,
X-Forwarded-For
是用于记录代理信息的,每经过一级代理(匿名代理除外),代理服务器都会把这次请求的来源IP
追加在X-Forwarded-For
中A request from
4.4.4.4
, the header contains such a linemeans that the request is sent by
1.1.1.1
and passes through three layers of proxies. The first layer is2.2.2.2
and the second layer is3.3.3.3
, and the source IP of this request1.1.1.1
发出,经过三层代理,第一层是2.2.2.2
,第二层是3.3.3.3
,而本次请求的来源IP4.4.4.4
is the third layer proxyAnd
X-Real-IP
,没有相关标准,上面的例子,如果配置了X-Read-IP
, there may be two situationsSo, if there is only one layer of proxy, the values of these two headers are the same