Back

hosting assetlinks in the same server as appwrite?

  • 0
  • Self Hosted
  • Flutter
jesuswithBigD
18 Dec, 2023, 00:19

As appwrite is currently using.

TL;DR
The user wants to host the assetlinks.json file on the same domain as their Appwrite backend. They are asking if they need to add it to a project platform and if it should be on a subdomain. The solution is to run Nginx on ports 80 and 443 and run Appwrite on other ports. They can then access both Appwrite and the assetlinks.json file without specifying any additional ports.
jesuswithBigD
18 Dec, 2023, 00:19

Like this https://your.host.com/.well-known/assetlinks.json without any another port

Drake
18 Dec, 2023, 00:22

The reverse proxy should run on the standard ports and then it can forward requests for whatever host to the respective apps running on non-standard ports

Drake
18 Dec, 2023, 00:22

This is because only one app can be listening on a port at a time

jesuswithBigD
18 Dec, 2023, 00:28

Excuse me an not that expert but if setup it like this: If I try to access the appwrite using https://your-host.com And https://your.host.com/.well-known/assetlinks.json

Appwrite using Traefik And the new link using nginx Nothing will happen? Or do I have to Give the Nginx another port To access the file from web like this https://your.host.com:8081/.well-known/assetlinks.json

Drake
18 Dec, 2023, 00:29

You would run nginx on 443 and 80 and other apps like Appwrite on other ports, but you'll still be able to access Appwrite on ports 443 and 80

jesuswithBigD
18 Dec, 2023, 00:34

Ok, when the setup for appwrite asks me what ports do I want to use I have to use another ports than 80 and 443, and the appwrite will still work when I access it with the link Like this without any port: https://your-host.com/

jesuswithBigD
18 Dec, 2023, 00:34

Without any ports Specified ?

jesuswithBigD
18 Dec, 2023, 00:39

I wanna make the same domain host the appwrite and the file.

Drake
18 Dec, 2023, 00:42

Same domain won't work

jesuswithBigD
18 Dec, 2023, 00:46

This is the problem I want to host the file on the same domain, that's why I said if I can put it with the appwrite Because I want to access it like this

https://your.host.com/.well-known/assetlinks.json

when I open https//your-host.com It should open appwrite, then when opening : https://your.host.com/.well-known/assetlinks.json it should open the file

Drake
18 Dec, 2023, 00:46

You also shouldn't really have both on the same domain... Appwrite is your backend. The asset link is like your front end

jesuswithBigD
18 Dec, 2023, 00:47

Then the best thing is to make a sub domain For it?

jesuswithBigD
18 Dec, 2023, 00:48

And add it to a platform in appwrite in order for it to work ?

Drake
18 Dec, 2023, 00:48

For example, id have:

  1. Appwrite on appwrite.company.com
  2. App on example.com
  3. Custom endpoint on appwrite.example.com if needed
jesuswithBigD
18 Dec, 2023, 00:51

I'm making the app in flutter then i should do this: 1-example.com is my website 2- appwrite.example.com is appwrite. 3- something.example.com is my custom thing

jesuswithBigD
18 Dec, 2023, 00:53

Because I want to use the assetlinks.json for deeplink I have to put it under

https://something.example.com/.well-known/assetlinks.json

Right ?

jesuswithBigD
18 Dec, 2023, 00:55

Then I have to add it to my project platform

Drake
18 Dec, 2023, 00:55

Your main Appwrite domain should not be app specific because it's designed to be used for multiple apps

jesuswithBigD
18 Dec, 2023, 00:56
Drake
18 Dec, 2023, 00:56

The well known link would be on example.com

jesuswithBigD
18 Dec, 2023, 00:57

that's right I never thought of it😁😁

jesuswithBigD
18 Dec, 2023, 01:00

Do I have to add it to a project platform in order for it to works or since it is the main domain and appwrite is sub of it I don't have to?

Drake
18 Dec, 2023, 01:35

Yes, you will

jesuswithBigD
18 Dec, 2023, 01:35

Thanks,

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