I have an appwrite session behind apache proxy at appwrite.suven.com.np. The environment variables _APP_DOMAIN and _APP_DOMAIN_TARGET are set to appwrite.suven.com.np. The DNS has an A record pointing to the IP of the server. Using login from another page hosted at project.suven.com.np works but logs Appwrite is using localStorage for session management. Increase your security by adding a custom domain as your API endpoint.
to the console. Trying to add custom domain for appwrite.suven.com.np from the project settings returns 500 errors. The logs from docker is:
appwrite | [Error] Method: POST
appwrite | [Error] URL: /v1/projects/:projectId/domains
appwrite | [Error] Type: Appwrite\Extend\Exception
appwrite | [Error] Message: Unreachable CNAME target (appwrite.suven.com.np), please use a domain with a public suffix.
appwrite | [Error] File: /usr/src/code/app/controllers/api/projects.php
appwrite | [Error] Line: 1344
The documentation for adding custom domains mentions adding a CNAME record. What does that mean? For which URL should the CNAME record be set and what should it point to?
What did you add for your custom domain?
You shouldn't need to add your main domain as a custom domain. To make the warning go away, I think you need a domain that is a sub domain of your app. So appwrite.project.suven.com.np
However....I think the problem here is we don't recognize com.np as a valid TLD...you might want to create an issue for that
I tried suvenpandey.co and even google.com. It shows the same error on docker logs (with different timestamps ofc). The url on Message: Unreachable CNAME target (appwrite.suven.com.np), please use a domain with a public suffix.
remains the same. ๐ค
This value comes from your domain target environment variable
So what did Appwrite is using localStorage for session management. Increase your security by adding a custom domain as your API endpoint.
message mean?
Appwrite isn't a subdomain of your front end app
So it's saying to create a custom domain that makes Appwrite a sub domain of your front end app.
But Appwrite thinks your domain target is invalid
I tried putting the frontend both above and below appwrite ie Appwrite at appwrite.suven.com.np Frontend at suven.com.np and appwrite at same url but frontend at appwrite.test.suven.com.np Maybe its the issue with .np country tld.
On which repo should I create issue for this?
Weird...it should work with Appwrite at appwrite.suven.com.np and front end at suven.com.np
Is your Apache proxy forwarding the host header?
Oh wait...NVM...yes, it's a problem with the com.np TLD
You can create it in the appwrite repo
For reference: https://github.com/utopia-php/domains/pull/29
Recommended threads
- I recently applied for the free plan und...
I recently applied for the free plan under the GitHub Student Developer Pack. However, my billing status still shows $15, and it mentions that this amount will ...
- Bug Report: Appwrite Console UI Issue on...
Steps to Reproduce: - Navigate to any collection page in the Appwrite console UI. - Open the menu and click on "Create Collection." - Observe that the dialog to...
- Send Email Verification With REST
I am using REST to create a user on the server side after receiving form data from the client. After the account is successfully created i wanted to send the v...