
Hi everyone,
I have a problem where, when a user logs in, the saved IP address is the server’s IP instead of the user’s real IP. I followed this guide: How to Run Appwrite Behind Nginx, but I’m not sure how to fix it.
I’m using a Next.js app with SSR for login and registration. Here’s my function for creating a session:
export async function createSessionClient(): Promise<AppwriteClient> {
const client = new Client()
.setEndpoint(process.env.NEXT_PUBLIC_APPWRITE_ENDPOINT!)
.setProject(process.env.NEXT_PUBLIC_APPWRITE_PROJECT!);
const cookieStore = await cookies();
const session = cookieStore.get("auth-session");
if (!session || !session.value) {
throw new Error("No session");
}
client.setSession(session.value);
return {
get account() {
return new Account(client);
},
};
}
How can I get the user’s real IP instead of the server’s IP? Any help would be really appreciated!
Thank you!
Recommended threads
- Reset/Recalculate Dashboard Values
Is there a way to reset/recalc this value on the dash? I had issues importing, and after my second import this was how it ended, I've since added some documents...
- Sites_: 500 Server Error when connecting...
I am trying to set up Sites on my self-hosted Appwrite instance. I have a GitHub Organization with a repo I want access to. I had previously installed the appwr...
- Migration failed after upgrading from 1....
Upgraded from 1.6.2 to 1.7.1 then run migration command No errors in browser console But stuck at appwrite loader and never gets in. Not sure of the type of ...
