亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

nginx - What is the difference between X-Forwarded-For and X-Real-IP?
伊謝爾倫
伊謝爾倫 2017-05-16 17:26:04
0
1
960

What is the difference between X-Forwarded-For and X-Real-IP?

After testing, I found that the IP obtained is the same.

伊謝爾倫
伊謝爾倫

小伙看你根骨奇佳,潛力無(wú)限,來(lái)學(xué)PHP伐。

reply all(1)
曾經(jīng)蠟筆沒(méi)有小新

Generally speaking, X-Forwarded-For是用于記錄代理信息的,每經(jīng)過(guò)一級(jí)代理(匿名代理除外),代理服務(wù)器都會(huì)把這次請(qǐng)求的來(lái)源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發(fā)出,經(jīng)過(guò)三層代理,第一層是2.2.2.2,第二層是3.3.3.3,而本次請(qǐng)求的來(lái)源IP4.4.4.4 is the third layer proxy

AndX-Real-IP,沒(méi)有相關(guān)標(biāo)準(zhǔn),上面的例子,如果配置了X-Read-IP, there may be two situations

// 最后一跳是正向代理,可能會(huì)保留真實(shí)客戶端IP
X-Real-IP: 1.1.1.1
// 最后一跳是反向代理,比如Nginx,一般會(huì)是與之直接連接的客戶端IP
X-Real-IP: 3.3.3.3

So, if there is only one layer of proxy, the values ??of these two headers are the same

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template