Back

How do I add subdomain as backend subdomain and function subdomain?

  • 0
  • Self Hosted
  • Functions
THE-E
5 Nov, 2023, 14:08

I am unsure about my current setup of my appwrite backend.

So I have a domain example.com and I would like appwrite to be accessible under baas.example.com. Currently my nginx proxy manager forwards request to baas.example.com to my appwrite traefik appwrite-traefik:80 instance. Which works fine.

My appwrite functions are accessible using baas.example.com/functions/....

My .env file contains the following entries:

TypeScript
_APP_DOMAIN=baas.example.com
_APP_DOMAIN_FUNCTIONS=function.example.com
_APP_DOMAIN_TARGET=baas.example.com

Is this the correct setup? And what exactly is the difference between _APP_DOMAIN and _APP_DOMAIN_TARGET_?

And how do I setup my functions endpoint (domain)? My desired endpoint is function.example.com?

TL;DR
User wants to know how to add a subdomain as both a backend subdomain and a function subdomain. They are confused about the difference between `_APP_DOMAIN` and `_APP_DOMAIN_TARGET` in the .env file. They also want to know how to set up their functions endpoint using the domain `function.example.com`. Solution: - The `_APP_DOMAIN` and `_APP_DOMAIN_TARGET` can be the same. The target is used for adding a custom domain for a project. - To set up the functions endpoint, another entry in NPM is needed to forward `function.example.com` to Appwrite. - The current setup
THE-E
5 Nov, 2023, 14:09

How do I add subdomain as backend subdomain and function subdomain?

Drake
5 Nov, 2023, 22:14

Seems fine.

You need another entry in NPM to forward function.example.com to Appwrite

THE-E
6 Nov, 2023, 20:19

But should _APP_DOMAIN and _APP_DOMAIN_TARGET be the same? What is the difference? When using the function.example.com domain to access the functions, do I still use the pattern functions.example.com/functions/... or does it have a different pattern?

Drake
6 Nov, 2023, 20:50

App domain and app domain target are usually the same. The target is used for adding a custom domain for a project. It validates the custom domain is pointed to the right thing.

The function domain allows you to hit your function directly and not follow the usual requirements of hitting Appwrite's APIs

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