# Mautic not tracking correct IP, It always shows localhost!

**URL:** https://forum.mautic.org/t/mautic-not-tracking-correct-ip-it-always-shows-localhost/33387
**Category:** Product Support
**Created:** [September 5, 2024, 11:17am UTC](https://forum.mautic.org/t/mautic-not-tracking-correct-ip-it-always-shows-localhost/33387 "2024-09-05T11:17:35Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![itsmunyrhere](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/itsmunyrhere/32/12657_2.png) [@itsmunyrhere](https://forum.mautic.org/u/itsmunyrhere)
#### Post date: [September 5, 2024, 11:17am UTC](https://forum.mautic.org/t/mautic-not-tracking-correct-ip-it-always-shows-localhost/33387/1 "2024-09-05T11:17:35Z")

</div>

**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.

---

<div class="post-metadata">

### Author: ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)
#### Post date: [September 10, 2024, 1:20pm UTC](https://forum.mautic.org/t/mautic-not-tracking-correct-ip-it-always-shows-localhost/33387/2 "2024-09-10T13:20:07Z")

</div>

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