-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
馃悰 Bug Report: Session object store incorrect info #4893
Comments
@usamashafiqs thanks for raising this issue! 馃檹馃徏 Do you have a reverse proxy in front of Appwrite? |
I did not have any reverse proxy in front of Appwrite. But appwrite already have traefik as reverse proxy. |
Traefik should be fine and shouldn't interfere with the IP address that is collected. Do you have anything else running on the server? Do you have anything else in front of Appwrite? Any other information you can provide about your infrastructure/architecture? |
The problem could be Cloudflare proxy. Since the request some from Cloudflare proxy, Appwrite uses that as the source IP address. In order to get Appwrite to use the IP address before Cloudflare, you'll have to tell Appwrite to trust Cloudflare and use the IP passed in the header using the forwardedHeaders option. I would recommend creating a services:
traefik:
command:
- --providers.file.directory=/storage/config
- --providers.file.watch=true
- --providers.docker=true
- --providers.docker.exposedByDefault=false
- --providers.docker.constraints=Label(`traefik.constraint-label-stack`,`appwrite`)
- --entrypoints.appwrite_web.address=:80
- --entrypoints.appwrite_websecure.address=:443
- --entrypoints.appwrite_web.forwardedHeaders.trustedIPs=<IP Address of Cloudflare>
- --entrypoints.appwrite_websecure.forwardedHeaders.trustedIPs=<IP Address of Cloudflare> The list of Cloudflare IP Addresses can be found here. After creating this file, run Alternatively, you can trust all IPs by putting this instead of the - --entrypoints.appwrite_web.forwardedHeaders.insecure
- --entrypoints.appwrite_websecure.forwardedHeaders.insecure |
@stnguyen90 thanks! It worked. |
馃憻 Reproduction steps
Session showing me my host server IP and Location instead of logged in user.
馃憤 Expected behavior
Session should show logged in user IP and Location.
馃憥 Actual Behavior
Session showing me my server IP and Location instead of logged in user.
馃幉 Appwrite version
Version 1.1.x
馃捇 Operating system
Linux
馃П Your Environment
No response
馃憖 Have you spent some time to check if this issue has been raised before?
馃彚 Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: