#獲取用戶真實IP,并賦值給變量$clientRealIP
map $http_x_forwarded_for? $clientRealIp {
? "" $remote_addr;
? ? ? ? ~^(?P<firstAddr>[0-9\.]+),?.*$? $firstAddr;
}
#獲取用戶真實IP,并賦值給變量$clientRealIP
map $http_x_forwarded_for? $clientRealIp {
? "" $remote_addr;
? ? ? ? ~^(?P<firstAddr>[0-9\.]+),?.*$? $firstAddr;
}