Back

[SOLVED] Reverse proxy settings

  • 0
  • Self Hosted
  • Accounts
  • General
  • Web
kathelia.dokgu
14 Sep, 2023, 19:42

A few weeks ago I moved my self-hosted Appwrite instance behind a reverse proxy (using Nginx Proxy Manager) - I just noticed that if I go into Auth > User > Sessions, the IP address being reported is the private IP address and so location is always unknown. It looks like Appwrite isn't getting the correct IP address. Is this an Appwrite configuration that I just missed or is this something that I need to do on the NPM side?

TL;DR
The user mentions that they solved their issue by using the private IP instead of the public IP. They also ask if they should use the private IP instead of the static public IP when looking at user sessions in Appwrite. Additionally, they mention that when accessing NPM through the IP address, it doesn't show NPM and they get a "404 Not Found" error. They provide their `docker-compose.override.yml` file and ask if they should add the configuration to the main `docker-compose.yml` file instead. Finally, they ask if there is an Appwrite or NPM configuration they may have missed regarding the incorrect IP address.
kathelia.dokgu
14 Sep, 2023, 20:07

I already have this added to the docker-compose.override.yml file. Should this be added to the main docker-compose.yml file instead?

kathelia.dokgu
14 Sep, 2023, 20:27

Here's my docker-compose.override.yml:

TypeScript
version: '3'
services:
  traefik:
    command:
      - --accessLog=true
      - --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_MASKED_IN_THE_SCREENSHOT
      - --entrypoints.appwrite_websecure.forwardedHeaders.trustedIPs=IP_MASKED_IN_THE_SCREENSHOT
networks:
  gateway:
    name: npm_gateway
    external: true
kathelia.dokgu
14 Sep, 2023, 20:30

NPM is accessible through proxy.domain.com - but somehow if I put the IP address on the browser's address bar, it doesn't show NPM.

When accessed as http://IP_MASKED_IN_THE_SCREENSHOT, I get: 404 Not Found openresty. If accessed as https://IP_MASKED_IN_THE_SCREENSHOT, I get: ERR_SSL_UNRECOGNIZED_NAME_ALERT.

Drake
14 Sep, 2023, 20:37

uhhh the ip address that's shown in appwrite...isn't tha the ip address of NPM?

kathelia.dokgu
14 Sep, 2023, 20:50

When I look at any user's sessions, it shows 172.22.0.2 which is a private internal IP. It's probably the IP of NPM, should I use this IP instead of the static public IP?

kathelia.dokgu
14 Sep, 2023, 20:57

Okay when I used the private IP instead of the public IP, it worked. Thanks!

Drake
14 Sep, 2023, 22:48

[SOLVED] Reverse proxy settings

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