Back

Appwrite behind NAT

  • 0
  • Self Hosted
  • Functions
bluesky
7 Jan, 2024, 05:22

Hello, anyone have an best practice how to deploy Appwrite behind NAT

This my infrastructure flow

vm (local ip address) -> nginx reverse proxy (setup domain) -> cloudflare (set A record to public ip address)

The question how can I done with function domain?

TL;DR
Issue: The user is trying to deploy Appwrite behind NAT and is facing difficulties in setting up SSL and accessing Appwrite. Solution: 1. Check the SSL certificate: Verify that the SSL certificate is set correctly and matches the domain name. 2. Generate a new SSL certificate: Use the command `docker compose exec appwrite ssl` to generate a new SSL certificate for the Appwrite server. 3. Check Docker Compose: Ensure that NPM (Nginx Proxy Manager) is running as a docker container by checking the `docker-compose.yml` file and the specified ports and volumes. 4. Verify NPM setup: Confirm
Drake
7 Jan, 2024, 05:23

What's the problem?

bluesky
7 Jan, 2024, 05:24

My Appwrite can't be acces.

Drake
7 Jan, 2024, 05:25

The most important things are to make sure traffic that hits Appwrite is https has the host header set

bluesky
7 Jan, 2024, 05:26

This the settings of proxy

bluesky
7 Jan, 2024, 05:26

And not using SSL for the proxy

bluesky
7 Jan, 2024, 05:28

And this setup for the cloudflare

Drake
7 Jan, 2024, 05:28

Is NPM running in a docker container?

bluesky
7 Jan, 2024, 05:28

How can I check this?

Drake
7 Jan, 2024, 05:29

How'd you set up NPM?

bluesky
7 Jan, 2024, 05:29

Node Package Manager?

Drake
7 Jan, 2024, 05:29

Nginx proxy manager

bluesky
7 Jan, 2024, 05:30

Owh, no. Nginx Proxy Manager is running in other VM. Which is one segment with the Appwrite..

bluesky
7 Jan, 2024, 05:32

Owh, but Nginx Proxy Manager default is running inside docker

bluesky
7 Jan, 2024, 05:33

This the docker-compose of the NPM

TypeScript
version: '3.8'
services:
  app:
    image: 'jc21/nginx-proxy-manager:latest'
    restart: unless-stopped
    network_mode: "host"
    ports:
      - '80:80'
      - '81:81'
      - '443:443'
    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt
Drake
7 Jan, 2024, 05:40

Oh so NPM and Appwrite are on different servers?

bluesky
7 Jan, 2024, 05:41

Yes

bluesky
7 Jan, 2024, 05:44

I was generate for new SSL with docker compose exec appwrite ssl but nothing happend. This the logs.

bluesky
7 Jan, 2024, 05:45

If I check the certificate, this use traefik default cert.

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