Skip to content
Back

[CLOSED] Appwrite behind Nginx, locale.get() returns internal IP

  • 0
  • Resolved
  • 3
  • Self Hosted
Lexy
21 Nov, 2025, 19:03

I have Appwrite behind Nginx and followed this guide to forward the real user IP: https://medium.com/@stnguyen90/how-to-run-appwrite-behind-nginx-19348ed34243

This works for e.g. user sessions, it saves the real user IP for each session created but the Locale API (Get user locale, https://appwrite.io/docs/references/1.8.x/client-web/locale#get) still returns the internal docker IP: {"ip":"172.18.0.1","countryCode":"--","country":"Unknown","continentCode":"--","continent":"Unknown","eu":false,"currency":""} and no data for country etc.

Is this a bug or am I missing something?

TL;DR
Appwrite behind Nginx, locale.get() was returning internal IP. Solution: Trust the proxy at Traefik with `forwardedHeaders.trustedIPs`. Issue likely resolved as it works and returns the correct IP now, believed to be due to caching.
21 Nov, 2025, 20:56

You need to trust the proxy at traefik with forwardedHeaders.trustedIPs If I'm not wrong. https://doc.traefik.io/traefik/reference/install-configuration/entrypoints/#opt-forwardedHeaders-trustedIPs

21 Nov, 2025, 21:30

Yes, I added the forwardedHeaders.insecure and it works for sessions but not the locale for some reason

21 Nov, 2025, 22:47

Not sure then. Cc <@462046107556511744> do you have some idea? πŸ˜…

21 Nov, 2025, 23:49

It has the correct IP for me. You sure something isn't caching that locale response?

22 Nov, 2025, 09:16

Today it works and returns the correct IP, it must have been cached somewhere (tried several browsers yesterday and didn't work in any then), strange πŸ™‚

22 Nov, 2025, 09:17

[CLOSED] Appwrite behind Nginx, locale.get() returns internal IP

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more