Mautic not tracking correct IP, It always shows localhost!

Your software
My Mautic version is: 5.0.4
My PHP version is: 8.1
My Database type and version is: RDS–mysql

Your problem
My problem is: That I cannot log real IPs in database, I have deployed mautic in EKS (AWS kubernetes) and ingress is being handled by NGINX controller.

I am allowing all IPs and most of the headers in my helm:
trustedIPs: ‘0.0.0.0/0,REMOTE_ADDR,’
trusted_headers: [‘x-forwarded-for’, ‘x-forwarded-host’, ‘x-forwarded-proto’, ‘x-forwarded-port’, ‘x-forwarded-prefix’]

These errors are showing in the log:
kubectl logs -f mautic-cluster -n dev
127.0.0.1 - 05/Sep/2024:09:42:46 +0000 “POST /index.php” 400
127.0.0.1 - 05/Sep/2024:09:42:46 +0000 “POST /index.php” 422
127.0.0.1 - 05/Sep/2024:09:42:47 +0000 “POST /index.php” 422
127.0.0.1 - 05/Sep/2024:09:42:47 +0000 “POST /index.php” 422
127.0.0.1 - 05/Sep/2024:09:42:47 +0000 “POST /index.php” 422

In my nginx logs
[172.71.146.228][172.71.146.228][172.71.146.228] - - [05/Sep/2024:11:13:47 +0000] “POST /api/contacts/new HTTP/1.1” 400 211 “-” “axios/1.6.7”
[172.71.147.124][172.71.147.124][172.71.147.124] - - [05/Sep/2024:11:13:47 +0000] “POST /api/contacts/new HTTP/1.1” 422 133 “-” “axios/1.6.7”
[172.71.147.220][172.71.147.220][172.71.147.220] - - [05/Sep/2024:11:13:47 +0000] “POST /api/contacts/new HTTP/1.1” 422 133 “-” “axios/1.6.7”

Steps I have tried to fix the problem:
I have already added headers inside nginx and symphony conf, I believe this is how the flow goes:
request → load balancer → nginx controller → php-fpm (mautic)

I think real is passing correctly till nginx controller but fails near php-fpm

Can anyone help me with this? Thanks.

Hi, are you passing the original header in the load balancer?
What are you using? I can help with Haproxy