Update on point2 - %2 is now removed and below is a sample log
<LB_IP> - - [22/Jun/2022:11:23:15 +0530] "GET /login HTTP/1.1" 302 154 "https://<url>/""Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36" "<http_x_forwarded_for_IP>"--"<http_x_forwarded_for_IP>, <LB_IP>"--
log_format custom '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer"'
'"$http_user_agent" "$http_x_forwarded_for"'
'--"$proxy_add_x_forwarded_for"--';
Does ip_hash work based on http_x_forwarded_for header value?