My web app is hosted on heroku (Ruby on Rails). I use Amazon Route 53 for DNS. I have followed the Heroku docs for configuring Automated Certificate Management so my app can serve HTTPS. I have tested this through a web browser and I am able to access the site fine with HTTPS. I'm relatively certain that a) routing to heroku is working 2) https is working. 

Here is where the difficult comes in. I am trying to get my app association file to work with my mobile app. I am able to pull up the file by going to my domain: <https://www.example.com/apple-app-site-association>. 

My ruby app serves up the file in the manner suggested by this SO post:<https://stackoverflow.com/a/35588346/5357940>. 

I have validated that the link is working without redirects with redirectcheck.com. This shows the content type is correct and that there are no redirects happening. 

<https://www.example.com/apple-app-site-association>

HTTP/1.1 200 OK  

Server: Cowboy  

Connection: close  

Date: Tue, 28 Mar 2017 23:29:50 GMT  

Status: 200 OK  

X-Frame-Options: SAMEORIGIN  

X-Xss-Protection: 1; mode=block  

X-Content-Type-Options: nosniff  

Cache-Control: no-cache  

Content-Type: application/json; charset=utf-8  

X-Request-Id: 21fd0610-2797-4c83-81ec-d54616086036  

X-Runtime: 0.184758  

Via: 1.1 vegur 

When I run the apple validator, all the tests pass except for the "Link To Application" test. The error returned is:

App Name Domain
Link <http://www.example.com/testlink>  

Bundle Id com.example.app  

Universal false  

Error cannot fetch app site association 

I have read through all the other SO question on this topic, but can't find one that addresses the specific problem I am having. 

p.s. I have replaced the name of the app with domain.