plausible / docs

Documentation for Plausible Analytics
https://plausible.io/docs
Creative Commons Attribution Share Alike 4.0 International
226 stars 200 forks source link

fix: Correct X-Forwarded-For header to preserve client IP when behind… #475

Closed 365cent closed 8 months ago

365cent commented 8 months ago

… a CDN

This commit addresses an issue where the IP address of the CDN node was being forwarded in the X-Forwarded-For header, instead of the original client's IP address. By correctly appending the client's IP to the existing X-Forwarded-For header value (if present) or setting it as the initial value (if not), we ensure that the original client IP is preserved and forwarded correctly when requests pass through a CDN. This change enhances the accuracy of client IP tracking and improves compatibility with downstream services relying on the X-Forwarded-For header for client IP identification."