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
- Having issues with login via CLI
``` ~/appwrite ξ° appwrite login --endpoint https://localhost/v1 --verbose ? Enter your email myvalidemai...
- 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...
- Use different email hosts for different ...
Hello, I have 2 projects and i want to be able to set up email templates in the projects. Both projects will have different email host configurations. I see ...