Back

Appwrite Functions Custom Domain REST API

  • 0
  • Self Hosted
  • Functions
SonOfBoo
10 Jan, 2024, 04:24

**Noob Question: ** How do I use a custom domain to make a REST API with Appwrite Functions?

Environment: Appwrite: 1.4.13 Function Runtime: swift-5.8 self-host: digitalocean domain: piratesparadox.net subdomain for functions: api.piratesparadox.net domain provider: squarespace

_APP_DOMAIN=piratesparadox.net _APP_DOMAIN_FUNCTIONS=api.piratesparadox.net _APP_DOMAIN_TARGET=piratesparadox.net _APP_ENV=production

I’m trying to follow the custom domain docs here: https://appwrite.io/docs/products/functions/deployment#domains

When I create a function deployment and add a custom domain, everything shows as verified.

However, when I try to make a request I keep getting a generic 500 error.

I’ve tried several variations: https://api.piratesparadox.net/getPlayer?id=1 http://api.piratesparadox.net/getPlayer?id=1 https://api.piratesparadox.net/v1/getPlayer?id=1

I believe the attached screenshot from squarespace indicates that I have an SSL certificate?

Am I missing something obvious? Please let me know if you need more detail.

TL;DR
The user is experiencing a 500 error when trying to make a request to a custom domain in Appwrite Functions. They have followed the custom domain documentation and verified everything, but the issue persists. They have tried various URL variations and checked the SSL certificate. They are seeking assistance and wondering if they are missing something. Solution: It seems that the issue may be related to the HTTPS force option being disabled for function domains. Enabling this option could potentially resolve the problem. Additionally, the user should ensure that they have proper logging enabled and check for any potential errors or issues in their configuration.
ideclon
10 Jan, 2024, 04:27

Do you see an Execution created in Appwrite when you make the request?

SonOfBoo
10 Jan, 2024, 04:29

Ooo it does! I've been struggling to get the domain working so long that I didn't even think I was this far along 😂

https://api.piratesparadox.net/v1/getPlayer?id=1

An internal curl error has occurred within the executor! Error Msg: Http invalid protocol\nError Code: 500

ideclon
10 Jan, 2024, 04:44

That commonly means you’re logging too much

SonOfBoo
10 Jan, 2024, 04:48

Doubling checking it looks like I don't have any logging. No swift prints and no RuntimeContext.logs / errors

SonOfBoo
10 Jan, 2024, 04:59

Could this be related?

👩‍⚕️ Running Appwrite Doctor for version 1.4.13 ...

[Settings] 🟢 Hostname has a public suffix (piratesparadox.net) 🟢 CNAME target has a public suffix (piratesparadox.net) 🟢 Using a unique secret key for encryption 🟢 App environment is set for production 🟢 Abuse protection is enabled 🟢 Console access limits are enabled 🔴 HTTPS force option is disabled 🔴 HTTPS force option is disabled for function domains 🔴 Logging adapter is disabled

ideclon
10 Jan, 2024, 05:05

Shouldn’t be

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