Skip to content
Back

CORS error when using Custom Domain on localhost

  • 0
  • Web
  • Cloud
кеni
28 Apr, 2024, 01:40

I'm getting a CORS error when trying to access my custom domain API endpoint from localhost. The custom endpoint is set up at appwrite.sparkandmint.com and I think the /v1 path works as intended. However, my domain is hosted on GoDaddy where SSL is really expensive so I decided to point the sub-domain CNAME to Netlify where I can use a free Let's Encrypt SSL cert and just re-direct to cloud.appwrite.io from there (which works if you visit the endpoint). I have added all the hostnames (wildcard, localhost etc.) in multiple platforms but I can't get past the CORS error. Is my Netlify hack causing the CORS? Do I really have to pay a ton of money on GoDaddy to add SSL to 1 subdomain? Is there any other way I can do this?

TL;DR
Developers are experiencing a CORS error when trying to access a custom domain API endpoint from localhost. They pointed the subdomain's CNAME to Netlify for a free SSL certificate, but are still encountering issues. The solution is to have Appwrite generate the certificate and then create a CNAME to point to Appwrite. Not necessary to pay for an expensive SSL from GoDaddy.
Steven
28 Apr, 2024, 01:43

Netlify? Yes, you can't do that.

Appwrite will generate the certificate. Just create a CNAME to point to Appwrite

кеni
28 Apr, 2024, 01:44

Ok so I need to set up the SSL for my sub-domain in GoDaddy?

Steven
28 Apr, 2024, 01:45

No, you don't need to set up any ssl. Just create a CNAME record pointing to cloud

кеni
28 Apr, 2024, 01:45

Oh ok, I was running into some cert issues when I did that and thought that was the issue

кеni
28 Apr, 2024, 01:46

Let's see what error I got, sec

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