#CNAME and A DNS records for Appwrite functions

1 messages · Page 1 of 1 (latest)

solemn fulcrum
#

Everything gets validated, the domain is verified and the certificate created, how do I access that function?
If I go to myfunction.mydomain.com, I get a Error 400 type general_argument_invalid

#

(My function is working fine with a regular manual execution)
I don't even see a new execution on the list how do I get to that function with REST?

fallen viper
#

@still schooner do you know what could have gone wrong here?

solemn fulcrum
#

To elaborate a little bit, if I setup a domain for the functions on my .env file I have to create an A record on my dns directly to my server, why is that appwrite asks or let config a CNAME for the function, that's what I don't get.

fallen viper
#

Is this all happening on Cloud or a self hosted instance?

#

If on self hosted, can you check if it works on Cloud?

winged river
solemn fulcrum
solemn fulcrum
#

That's with that and I understand how it works, but for the functions tho, I think is a little bit messy or maybe I'm overthinking it, but

#

On the functions setting why there is a CNAME input when if I create that CNAME of like: function1.mythirddomain.org pointing also to my main appwrite.mydomain.com, so I can call the function with curl or axios, that won't work, I'm just creating a CNAME for the whole project. If I want a domain and subdomain for that function I need a A record pointing to the IP because the CNAME won't work

winged river
solemn fulcrum
#

And there is no execution

winged river
#

And what version of Appwrite are you on?

solemn fulcrum
#

had 1.4.9, just updated to 1.4.12, still the same

#

Just ins case, permissions are set to Any

winged river
solemn fulcrum
#

So if I add a domain to _APP_DOMAIN_FUNCTIONS, like functions.myextradomain.com, I will get a function domain as <function_id>.functions.myextradomain.com and I will have to create a A record on my DNS and point it to the IP address of the server, but that's a different story

winged river
#

Anything in your Appwrite docker logs?

solemn fulcrum
#

yup

winged river
winged river
solemn fulcrum
#

For that I would need a A record

#

If that's the case, this CNAME inside the function would be useless, it would be the same as the project CNAME

winged river
winged river
winged river
#

For example, on cloud we have our app domain as cloud.appwrite.io. we have *.appwrite.global pointing to cloud.appwrite.io and appwrite.global configured as the function domain so that when a function is created, people get a url for their function automatically. However, if people want a custom one like mycustom.domain, they can add a custom function domain

solemn fulcrum
#

Ok, but every function will need it's own A record right?

#

<function_id>.whateverdomain.com

winged river
solemn fulcrum
#

Then how do I point the specific function to the domain

#

Tha'ts what I'm doing right now and it's not working

#

if I create a CNAME to that domain on my function settings, it will be just a CNAME to that domain, the server has no clue which function it is

#

a cname is an alias

winged river
solemn fulcrum
#

oh, ok, but that wildcard is an A record

winged river
#

The point is to make it so you don't have to change multiple DNS records if your IP address needs to change

solemn fulcrum
#

I've done that, created a CNAME wildcard *.fun.myotherdomain.com pointing to my appwrite.mydomain.com, but still error

solemn fulcrum
winged river
# solemn fulcrum

Is this from a function from before you set the environment variable?

solemn fulcrum
#

Nope, it's the regular function

#

no env vars, just a console log