But then the base app would be unsecured
Or would that be solved by NPM (Nginx Proxy Manager) ?
are you saying your front end app is not connecting to console.whatever?
do you also have NPM in front of appwrite?
Well, I'm kind of cheating, because I also redirecting myapp.mydomain.tld/v1/ to be served by the appwrite service in the traefik config. Because I don't have yet an certificate for console., the app would not work without this
Not yet, but I'm planning on adding it
π this doesn't really sound right...
probably best to set this up first especially if you're already hosting multiple apps on the same server. and if you're using NPM, Appwrite's certificates wouldn't really matter
Great, I'll set it up then
_APP_DOMAIN should be your main domain (like console.whatever). For project specific endpoints, you can use custom domains (https://appwrite.io/docs/custom-domains). But, like I said, if you're using NPM, you may not need to add a custom domain since NPM would handle the certificate generation.
For using NPM in front of Appwrite, you can refer to this: https://medium.com/@stnguyen90/how-to-run-appwrite-behind-nginx-19348ed34243
Awesome! Thanks a lot!! π― π
I didn't understand this from the article:
<IP Address of NPM> How do I get this IP, if it's running on the same server ?
Is it 127.0.0.1, even though it's inside of docker ?
not 127.0.0.1
is the public IP of the server ?
so traefik and NPM should be in the same docker network and have an IP address in that network. You can run docker inspect <network> to get the containers in the network
Good, I'll try that
Is it (1) IPAM.Config[0].Gateway or (2) Containers.{ID}.IPv4Address ? Option (2) has a "/16" subnet mask after the address, does it work with that ?
it would be the IPv4 Address without the subnet mask
Got it
I got the domains working with https in NPM, in the console everything works. But when the frontend app calls the console endpoints, there are some cors errors. The frontend calls this:
GET https://console.myapp.mydomain.tld/v1/account
origin: https://myapp.mydomain.tld
referer: https://myapp.mydomain.tld/
In the devtools logs:
Access to XMLHttpRequest at 'https://console.myapp.mydomain.tld/v1/account' from origin 'https://myapp.mydomain.tld' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header has a value 'https://localhost' that is not equal to the supplied origin.
It's very strange because before the GET /v1/account, the browser sends an OPTIONS /v1/account, and on the Options method the server replies with the right access-control-allow-origin: https://myapp.mydomain.tld.
But when the browser calls the Get method, for some reason the server replies with access-control-allow-origin: https://localhost, which I don't understand why. It doesn't appear to be related to NPM because it works in the Option method, but I dunno.
Did you add the hostname for your app as a web platform for your project in the Appwrite console?
Maybe not, I'll see
Yes, that solved it! Thanks again π
[SOLVED] Error when logging to console after account created in Chrome
Recommended threads
- 1:1 relationship doesnβt sync after re-a...
Hi, Iβm trying to use a two-way one-to-one relationship. It works fine when I create a record with the relationship set, and it also works when I unset it. But ...
- Upsert with setting permissions
Hi there, I am using self-hosted appwrite v1.7.4 and trying to use the bulk update stuff that was released with 1.7.x. Unfortunally I found that there is an ser...
- Github connection error - Self Hosted Ap...
I am trying to connect my github account to deploy a project to sites, but Connect to Gtihub button is disabled. I have configured all Env variables needed for...