Ip have request flows through 3 nginx proxy, and ip got the x-forwarded-for list ip of :
192.168.10.222, 192.168.10.178, 192.168.10.179
how can I get the first ip using map module ? I've found this but can't make it working:
map $proxy_add_x_forwarded_for $client_ip {
"~(?<IP>([0-9]{1,3}\.){3}[0-9]{1,3}),.*" $IP;
}
from here: https://webkul.com/blog/x-forwarded-for-header-in-nginx-containing-mulitple-client-ips
Thanks