Back

[SOLVED] Custom domain is not verified, but works in local environment, and not in production

  • 0
  • Self Hosted
  • Flutter
Kinga
25 May, 2023, 18:31

I was not able to verify my custom domain using cname, but I have appwrite.{my-custom-domain}.com as an A record in my cloudflare dns settings and can access it with no issues (connection is still http as well). Also I can access everything in local environment using the custom domain, but doesnt work when I build app on production.

TL;DR
Summary: The user is having trouble verifying a custom domain for their Appwrite project. They have added the custom domain as an A record in Cloudflare DNS settings and it works locally but not in production. The user is also unsure about how to add certificates for the custom domain. The support team explains that custom domains in Appwrite are for additional domains and the domain should be configured using the DOMAIN environment variables in the .env file. They also mention that Appwrite requires the instance to be publicly accessible in order to generate a certificate. Since the user's machine with Appwrite is behind a router, they need to enable port forwarding or create
Drake
26 May, 2023, 15:45

First off...how many hostnames do you need for Appwrite instance?

Kinga
26 May, 2023, 17:56

I am just using one: appwrite.cliqu3.com

Kinga
26 May, 2023, 17:57

And it works just fine locally using that domain, but when building production and using my app at app.cliqu3.com: I cannot use any appwrite functionality

Drake
26 May, 2023, 18:13

I see. So, you shouldn't be adding a custom domain in your appwrite project. Those are for additional domains for your project. Your domain should be configured using the DOMAIN env vars in the .env file.

Drake
26 May, 2023, 18:14

For this problem...did you add a web platform for your project with a matching hostname of your app?

Kinga
26 May, 2023, 18:58

I have my app domains listed as environment vars. And yes I am using my cliqu3.com hostname

Kinga
26 May, 2023, 18:59

I can access the appwrite.cliqu3.com and can use all db functions while using my localhost app, but not when I push build online

Kinga
26 May, 2023, 19:00

I thought you use the custom domains to add certificates as well, or how would I do that?

Kinga
26 May, 2023, 19:10

appwrite.cliqu3.com is only accessible on local network. Im not sure how to forward my appwrite ip to internet. Do I need more dns records?

Drake
26 May, 2023, 19:13

would you please share a screenshot of the web platform configured in your appwrite console?

Drake
26 May, 2023, 19:13

yes...but that's additional Appwrite endpoints

Drake
26 May, 2023, 19:15

if your appwrite instance isn't publicly accessible, Appwrite won't be able to generate a certificate for you. see https://appwrite.io/docs/certificates

it's not exactly a DNS thing..it's more network forwarding. Is your machine that has Appwrite running at home behind a router?

Kinga
26 May, 2023, 20:40
Kinga
26 May, 2023, 20:41

This is what you were looking for?

Kinga
26 May, 2023, 20:41

And yes, my machine is running at home behind a router

Kinga
26 May, 2023, 20:42

My website and app are too, but they work fine with cloudflare certs

Drake
26 May, 2023, 20:43

This is interesting...I expected to see a middle section for updating the platform 🧐.

How come your hostname seems backwards?

Kinga
26 May, 2023, 20:43

I think thats how flutter does applications? I might be doing something wrong

Drake
26 May, 2023, 20:44

So because it's behind a router, by default, when a network request comes in, there's nothing to say to route the request to the machine that needs to serve the request. You would need to either enable port forwarding or create a tunnel. I hear cloudflare tunnel works well.

Also, do you have anything else in front of Appwrite?

Drake
26 May, 2023, 20:45

Do you have a web app?

Kinga
26 May, 2023, 20:45

Yes

Kinga
26 May, 2023, 20:45

And what do you mean in front of appwrite?

Kinga
26 May, 2023, 20:45

I have port forwarding enabled on my router

Drake
26 May, 2023, 20:45

Then you need to put the actual hostname used for navigating to your web app

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