How to access .well-known folder from custom domain on Heroku?

1.7k views Asked by At

I can access the asset-links.json file which lies in the .well-know folder at the root of the domain via the Heroku's default domain as in:

www.heroku-default-domain.com/.well-known/asset-links.json

But when trying to access it via a custom domain whose DNS are pointing to the heroku's default domain as in:

www.my-custom-domain.com/.well-known/asset-links.json

I get the following error:

This site can’t be reached my-custom-domain.com refused to connect. Try: Checking the connection Checking the proxy and the firewall ERR_CONNECTION_REFUSED

Heroku support tells me the following:

Unfortunately, we dont have much insight on this as we can only direct your custom domain to point to your Heroku application, anything other than this should be done by the user on your app side. You need to check your app code for accessing those files.

The back end is NodeJs and Express. The /.well-know folder and the asset-links.json it contains are both static at the root of the domain.

1

There are 1 answers

1
tuancharlie On

Finally got it working.

I was using https://heroku-default-domain.com/.well-know/asset-links.json (which was working fine)

and https://my-custom-domain/.well-know/asset-links.json (which was not working)

the folder became accessible when I added www as in https://www.my-custom-domain/.well-know/asset-links.json

Other URLs are served well without the www.