Back

Some API request failing through cloudflare and nginx proxy manager

  • 0
  • Self Hosted
  • Web
Gybrid
24 May, 2024, 09:00

I'm hoping someone can point me in the right direction.

I have a fqdn and have a tunnel setup via cloudflare which goes to an nginx proxy manager which then goes to appwrite docker.

Cloudflare has WAP and ddos etc, which I think is partly my problem, but not the whole problem.

The issue i'm having is that majority of api calls are rejected when there's thousands of promises. if I bypass cloudflare and go direct to nginx proxy manager the majority will be resolved, and then if I bypass both cloudflare andproxy manager all will resolve.

Here's the error message when it fails.

status: 'rejected', reason: AppwriteException [Error]: fetch failed

Here's the split between resolved vs rejected promises depending on the route to make it a bit easier to see what I'm talking about

Route via cloudflare to nginx proxy to appwrite { okPromises: 443 } { rejectedPromises: 6277 }

Bypass cloudflare and go direct to nginx (within the lan) to appwrite { okPromises: 3944 } { rejectedPromises: 2776 }

Bypass cloudflare and nginx proxy manager and go direct to appwrite { okPromises: 6720 } { rejectedPromises: 0 }

Here's an example of the code

nodejs

TypeScript
let okPromises = 0;
let rejectedPromises = 0;
  const res = await Promise.allSettled(checkIfExistPromises)
    .then(results =>
      results.forEach(result => {
        if (result.status === "fulfilled") {
          okPromises++;
        }
        if (result.status === "rejected") {
          rejectedPromises++;
        }
      })
    )
    .catch(err => console.log(err.message));

Any ideas'? Thanks

TL;DR
Developers experiencing API request failures through Cloudflare and NGINX Proxy Manager. Issue: Majority of API calls are rejected when going through Cloudflare and NGINX Proxy Manager, but work when bypassing both. Error Message: `status: 'rejected', reason: AppwriteException [Error]: fetch failed` The split between resolved vs rejected promises: - Route via Cloudflare to NGINX Proxy to Appwrite: okPromises: 443, rejectedPromises: 6277 - Bypass Cloudflare and go direct to NGINX: okPromises: 3944, rejectedPromises:
Gybrid
24 May, 2024, 09:12

Some API request failing through cloudflare and nginx proxy manager

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