When I want to retrieve the country of each user, Appwrite's Local instance always returns an object with its data as Country "UNKNOWN".
{ip: 172.22.0.1, countryCode: --, country: Unknown, continentCode: --, continent: Unknown, eu: false, currency: }
Have you followed our docs? https://appwrite.io/docs/references/cloud/client-web/locale#listCountries
The country lookup is done using IP address. Looks like the IP address that's being detected is a local private IP address. Something needs extra configuring with your Appwrite instance. How's your environment set up (what do you have in front of Appwrite)?
Yes
My environment is in production
would you please provide more details?
I use Flutter 3.13.2
Appwrite 11.0.0
in front of Appwrite everything is okay
Apparently not. Do you have anything in front of Appwrite?
On my server?
Or wherever
On my server I only have Apache up front
Is apache in a docker container?
No
So just like any other backend server, Appwrite uses the IP of the incoming request and logs that as the users IP. When there are other systems in between the user, things get complicated. Systems will typically pass along the users IP address, but the receiving system (Appwrite) needs to trust that information. To do that, you would tell traefik to trust the sender
You would specify the trusted IPs: https://doc.traefik.io/traefik/routing/entrypoints/#forwarded-headers.
If you're 100% sure the Appwrite instance will not be hit from any other source, you can set insecure to true
I've just noticed that when I use my IP address with the port where Appwrite is installed on my server, they all work very well and I even have the right object {ip: 154.72.171.113, countryCode: CM, country: Cameroon, continentCode: AF, continent: Africa, eu: false, currency: }
But when I use the reverse proxy domain name linked to the ip address mentioned above, the problem starts all over again.
Recommended threads
- Migrate from cloud to localhost
Hello everyone. I need to migrate my test project from cloud to localhost, however it seems that this is possible only if a self-hosted appwrite instance it's h...
- Realtime with multiple connections
I need the Realtime on multiple Collections for diffrent applicational logic. So my question is: Is there a way to have only 1 Websocket connection or do I need...
- Can't login or deploy functions in Appwr...
Hello, since i updatet to the appwrite cli 6.1.0 i can't login or deploy functions with the cli. When i call the command: "appwrite get account --verbose" i ge...