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
- function subdomain ssl certs
The generated subdomain isn't getting a valid ssl cert, I was wondering if appwrite automatically generates one or uses a wildcard for *.functions.domain.com? ...
- Whats best practise for Appwrite Cloud?
Appwrite Teams map very nicely to my needs, it is how i group users together. ... I use roles to define permissions. Should I also map a table to each team ? ...
- Error getting preview of file
Rest Response: ``` { "message": "Server Error", "code": 500, "type": "general_unknown", "version": "1.8.1" } ``` Appwrite Logs ``` appwrite ...