v.21.1New Features
Add PROXYv1 Protocol Support for IP Address Quotas in ClickHouse
Add support forPROXYv1protocol to wrap native TCP interface. Allow quotas to be keyed by proxy-forwarded IP address (applied forPROXYv1address and forX-Forwarded-Forfrom HTTP interface). This is useful when you provide access to ClickHouse only via trusted proxy (e.g. CloudFlare) but want to account user resources by their original IP addresses. This fixes #17268. #17707 (alexey-milovidov).
Why it matters
This feature allows ClickHouse deployments that sit behind trusted proxy servers (such as CloudFlare) to accurately track and enforce quotas based on the client's original IP address rather than the proxy's IP. It addresses the issue where resource accounting was previously inaccurate due to proxy forwarding, improving access control and usage monitoring.How to use it
To use this feature, enable thePROXYv1 protocol wrapping on the native TCP interface in the server configuration. Quotas will then be applied based on the IP address provided by the PROXYv1 header or the X-Forwarded-For header from the HTTP interface, ensuring user sessions and resource limits correspond to the original client IP.