When RabbitMQ is deployed behind a load balancer, reverse proxy, firewall, or other network intermediary, the original client source IP address may not be visible in broker logs or connection metrics.
This limitation typically appears in two scenarios:
All supported RabbitMQ versions
It is due to upstream network devices utilizing NAT/SNAT features, which replace the actual client IP with the device's own pool IP.
1. Preserve the client IP for AMQP traffic
Configure the upstream load balancer or reverse proxy to send a Proxy Protocol header, and enable Proxy Protocol on RabbitMQ.
Add the following to rabbitmq.conf:
proxy_protocol = true
Proxy Protocol must be enabled on both the proxy and RabbitMQ. If the proxy sends Proxy Protocol but RabbitMQ is not configured to accept it, connections will fail.
2. Identify client IPs for HTTP / Management API authentication failures
For HTTP-based authentication failures, use RabbitMQ’s authentication-attempt tracking. RabbitMQ can record the source of authentication attempts, including the remote IP address, when source tracking is enabled.
After enabling source tracking, review authentication-attempt data through the management API or Prometheus metrics to identify the source address.
3. Use packet capture only for low-level verification
If needed during troubleshooting, capture traffic on the management port and inspect the Proxy Protocol header:
sudo tcpdump -i any -nn -As0 port 15672 | grep -B 3 -A 1 "YOUR_CLIENT_OR_APP_ID"
Note: Use this method as a verification aid rather than the primary operational approach.