Custom Domain: Where should the .well-known directory be?

Hi!

First time trying to set a custom domain via a boundary node and I need to clear some confusion. I’m using the official tutorial: Internet Computer Loading

  1. Multiple .ic-assets.json5 files

The project is a littler older. It was created via dfx new and there are two identical .ic-assets.json5 files: one in the /assets folder and another one in the /src folder. I suppose I need to add

[
    {
        "match": ".well-known",
        "ignore": false
    }
]

to both of these? Is that correct?

  1. Missing .well-known directory - where should I put it?

This might be obvious to some, but I don’t know where to place the .well-known directory in my project. The tutorial seems to imply that this folder already exists, but it doesn’t.

Would be great if someone could help me clarify these details. Thank you!

I’m using dfx for a custom domain in a single project only (in Juno this particular question is certified and handled automatically) and I’ve got the following configuration.

  1. In my app’s static asset folder, there is a single .ic-assets.json file. You can find an example here: link. Note that for SvelteKit, the folder is named static while with the React starter kit, it might be called assets (e.g., ./src/frontend/assets/).

  2. The .well-known directory is a sub-directory of the static assets folder. You can find an example here: link. This setup works when the static folder is bundled to the root of the website. The ultimate goal is to serve the .well-known directory at the root of the website.

For example, if the website is https://helloworld.com, the ic-domains file should be served through https://helloworld.com/.well-known/ic-domains.

I hope this provides the information you were looking for. Let me know if you have any further questions.

2 Likes

Beautiful. Works perfectly! Thank you!

1 Like