-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
How to forward client IP via HAProxy #833
-
Hi,
This isn't strictly a Plausible question, but as it's a vital step in making Plausible useful in its self-hosted form, I wondered if anyone had an example of the config for HAProxy > nginx which forwards the client IP to my web server when they hit HAProxy (so Plausible & geo-ip can work with it.
I've tried variations around the following, but my server only ever sees the HAProxy private-IP:
# HTTPS Frontend
frontend https-in
bind *:443 ssl crt /etc/letsencrypt/live/pem/
option forwardfor header X-Real-IP
http-request set-header X-Real-IP %[src]
Thanks
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 2 comments
-
I know this is old, but i just had this issue with missing geodata in plausible using HAProxy. All i needed was option forwardfor inside frontend https-in, nothing else :)
Beta Was this translation helpful? Give feedback.
All reactions
-
Tacking on some more info for others that might search this - for HAProxy on pfsense.
On each Backend - under Advanced Settings - Backend passthrough - add option forwardfor
Beta Was this translation helpful? Give feedback.