Back

[Solved] Getway time out Selfhost Configuration with Nginx (NPM) and Cloudflare.

  • 0
  • Self Hosted
ideclon
5 Sep, 2023, 09:06

Yes, I know what NPM is. But is Cloudflare pointing directly at the Appwrite port, or at NPM’s port?

TL;DR
The user was experiencing a gateway timeout issue with self-hosted configuration using Nginx and Cloudflare. They were seeking help and asking for error logs, but none were provided. Another user suggested using a Docker container for NPM and shared a helpful article. Eventually, the user marked the issue as solved without providing a solution.
s.o
5 Sep, 2023, 09:08

Ok in cloudflare it points to the VPS IP

ZiaChoudhary
5 Sep, 2023, 09:09

@s.o You can follow this guide to use Nginx as proxy server. 👇 https://medium.com/@zia-ch/how-to-run-appwrite-with-nginx-professionally-5ba420789ef0

ideclon
5 Sep, 2023, 09:10

And to port 80, I presume? Could you switch Cloudflare to point to the Appwrite port?

ideclon
5 Sep, 2023, 09:10

I don’t really see the relevance of NGINX here

s.o
5 Sep, 2023, 09:12

Because all the subdomains are managed by cloudflare?

s.o
5 Sep, 2023, 09:16

I checked the resource but had two questions.

  1. How do handle SSL certificates from cloudflare?
  2. Do I install NGINX as a docker container or directory on OS
ZiaChoudhary
5 Sep, 2023, 09:20

For option 2: you just have to install Nginx as described in the guide not as a container.

For 1: i think every request from cloud flare will already be an https request so you can easily redirect it to your appwritw instance.

You just need to follow the guide as such and if in case you face any issues, do contact.

s.o
5 Sep, 2023, 09:22

👍

s.o
5 Sep, 2023, 09:52

Kindly check my configuration. I have an A record in cloudflare that points to the VPS IP

ideclon
5 Sep, 2023, 09:58

I believe CF will be intercepting the request and therefore the ACME challenge is never reaching NGINX

ideclon
5 Sep, 2023, 09:59

But if you’re using CF as a proxy, CF issues a cert which terminates with them, and they’ll provide you with a certificate you can use locally that’ll only be accepted by CF

ideclon
5 Sep, 2023, 10:00

Although probably the simplest and most secure way to get it working is with Cloudflare Tunnels and cloudflared.

ZiaChoudhary
5 Sep, 2023, 10:01

You don't havd to write certboot commands because we use it to generate ssl and you already have your ssl from cloud flare so you don't need it just use all Nginx related commands.

ZiaChoudhary
5 Sep, 2023, 10:03

And your configuration is okey. Just run it and try to access your appwrite console. Also do check you have allowed Full Nginx.

s.o
5 Sep, 2023, 10:08

Still not reachable.

ZiaChoudhary
5 Sep, 2023, 10:09

May you show the error log or any errors that are showing up

s.o
5 Sep, 2023, 10:09

On browser or on appwrite instance?

ZiaChoudhary
5 Sep, 2023, 10:11

On browser and Nginx error log as well.

s.o
5 Sep, 2023, 10:28

Nothing being logged for nginx error log in the location /var/log/nginx/clinkod.access.log

s.o
5 Sep, 2023, 10:31

neither error.log

s.o
5 Sep, 2023, 10:34

This is the best route for me. This question should be marked as resolved

ideclon
5 Sep, 2023, 10:46

You can add [SOLVED] to the beginning of the title

s.o
5 Sep, 2023, 10:57

[Solved] Getway time out Selfhost Configuration with Nginx (NPM) and Cloudflare.

Drake
5 Sep, 2023, 19:17
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