Using traefik with frappe docker, user login is capturing Traefik's internal ip address

I’m a noob when it comes to server administration and devops. I have followed the single server example from frappe docker single server guide

So far I’ve managed to get everything working, but whenever a user login, the system is capturing traefik’s internal ip address instead of the user’s actual ip address, so in the activity log all users have the same ip address, which is traefik’s internal ip address. Which setting do I need to change, cause I’m pretty sure there must be a setting for it.

Thanks in advance.

Try setting nginx env var for frontend container. UPSTREAM_REAL_IP_HEADER. frappe_docker/docs/environment-variables.md at main · frappe/frappe_docker · GitHub

For anyone facing the same issue in the future, this is what I did. In my project’s .env file, I made the following changes:

UPSTREAM_REAL_IP_ADDRESS: {Traefik’s internal IP}
UPSTREAM_REAL_IP_HEADER: X-Forwarded-For
UPSTREAM_REAL_IP_RECURSIVE: “on”

Regenerate the .yaml file and rerun docker compose up.

1 Like