Skip to content
Back

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

  • 0
  • 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's Locale API is returning internal Docker IP instead of user's IP behind Nginx. The issue might be due to Appwrite not recognizing the forwarded IP correctly. Check if the X-Real-IP header is properly set in Nginx to pass the real user IP. Also ensure that the correct headers are forwarded to Appwrite.
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