Back

Discord Bot Template

  • 1
  • Self Hosted
  • Functions
safwan
29 Sep, 2023, 13:33

NPM is Nginx Proxy Manager in this case

TL;DR
The user is experiencing an error with their Discord bot template. They suspect that the issue may be related to the SSL certificate or the Discord public key environment variable. Another user suggests that the error could be fixed by setting up a reverse proxy using Nginx Proxy Manager. The user tries adding a wildcard A record to their DNS settings, which resolves the function URL issue but not the Discord error. Finally, another user recommends following a tutorial to set up a reverse-proxy with Docker to resolve the issue. Solution: Follow the tutorial provided (https://medium.com/@stnguyen90/how-to-run-appwrite-behind-nginx-19348
kamal.panara
29 Sep, 2023, 13:35

okay, so what do i need todo?

safwan
29 Sep, 2023, 13:36

How did you setup Appwrite on your machine?

safwan
29 Sep, 2023, 13:36

Did you install and set it up with Docker, or one of the one-click installs?

kamal.panara
29 Sep, 2023, 13:36

it's self hosted instance with docker on VPS KVM

kamal.panara
29 Sep, 2023, 13:37

with Docker command from appwrite self-host docs

safwan
29 Sep, 2023, 13:38

okay so now it's best if you create a reverse-proxy setup. use this tutorial to set it up: https://medium.com/@stnguyen90/how-to-run-appwrite-behind-nginx-19348ed34243

safwan
29 Sep, 2023, 13:38

Once you have this setup, you can create a Proxy Host for *.api.panara.studio

kamal.panara
29 Sep, 2023, 13:40

okay, why do i need that reverse proxy?

kamal.panara
29 Sep, 2023, 13:40

I'm new to this all, so asking.

Drake
5 Oct, 2023, 16:45

you need a reverse proxy if you have multiple apps running on a server that needs to be exposed on the same port...for your case, you might be able to just DNS records pointing to the server

kamal.panara
25 Oct, 2023, 08:35

okay let me try that

kamal.panara
25 Oct, 2023, 08:51

after adding new wild card A record (*.api.panara.studio) in my DNS settings the function URL is now working! but i'm still getting same error on discord:

kamal.panara
25 Oct, 2023, 08:52

and this is error i'm getting from cloud function.

kamal.panara
25 Oct, 2023, 09:29

is it due to ssl certificate? but it says ceritificate generated on appwrite console.

kamal.panara
25 Oct, 2023, 09:29
Drake
26 Oct, 2023, 01:02

No I don't think so

Drake
26 Oct, 2023, 01:02

Perhaps the discord public key environment variable is incorrect

Drake
26 Oct, 2023, 01:04

I don't know about this error

Drake
26 Oct, 2023, 01:05

You'll definitely get this error if you try to browse to the URL

Drake
26 Oct, 2023, 01:05

Anyways...SSL...did you set up nginx proxy manager or anything else in front of Appwrite?

kamal.panara
26 Oct, 2023, 03:06

Gets same error when. I send post request

kamal.panara
26 Oct, 2023, 03:07

I haven’t setup Nginx proxy or anything just installed Appwrite on VPS with that single docker command

Drake
1 Nov, 2023, 15:11

would you please try logging the following before the verifyKey() call:

TypeScript
req.headers['x-signature-ed25519']
req.headers['x-signature-timestamp']
process.env.DISCORD_PUBLIC_KEY
Drake
1 Nov, 2023, 15:12

and is the req.bodyRaw just a string?

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