After upgrading the TiDB cluster to 6.5, IP transparency through the Nginx proxy fails

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: tidb集群升级到6.5后,nginx代理的ip穿透失效

| username: wluckdog

[TiDB Usage Environment] After upgrading the TiDB cluster from 6.1 to 6.5, IP transparency failed, and all addresses are proxy addresses.
[TiDB Version] v6.5.0
[Reproduction Path]
[Encountered Problem: Phenomenon and Impact]
[Resource Configuration]
Source Configuration: Source configuration proxy-protocol.networks
Target Configuration: Nginx proxy, roughly as follows

stream {
  upstream test-cluster {
    server 172.107.10.111:5001 weight=1 fail_timeout=10s max_fails=5;
    server 172.107.10.111:5002 weight=1 fail_timeout=10s max_fails=5;
    ..........
    server 172.107.10.114:5002 weight=1 fail_timeout=10s max_fails=5;
  }
  server {
    listen 8000;
    proxy_pass test-cluster;
    proxy_protocol on;
  }
}

By querying the INFORMATION_SCHEMA.CLUSTER_PROCESSLIST table, the host addresses are all proxy addresses. Previously, the IP transparency configuration was working fine.
[Attachment: Screenshot/Log/Monitoring]

| username: ffeenn | Original post link

Is there an upper layer proxy?

| username: wluckdog | Original post link

After adding a layer of proxy to the TiDB instance, IP passthrough was still usable before the upgrade. However, after the upgrade, only the proxy address is displayed in the database.

| username: 玩具果冻 | Original post link

I followed the instructions on the PinCap official website for HAProxy and the proxy-protocol.networks parameter, but in version 6.5, I can’t get the source IP anymore; it’s always the IP and port of HAProxy. Can someone from the official team come out and explain or solve this issue?

| username: wzf0072 | Original post link

The link provided contains information about the command-line flags for TiDB configuration, specifically the --proxy-protocol-networks flag. You can refer to the documentation for detailed usage and configuration options.