My api.<base-url>
subdomain is not configured correctly. I purchased a domain through AWS and hooked it up to my static website running on Netlify. To do this, I set up Route53 to use Netlify's Name Servers. This works fine for the apex domain and https://<base-url>
sends me to the static site.
Image of the Route53 hosted zone for this domain
I also have a node instance running on Heroku which I want to be hosted at api.<base-url>
. Currently it is accessible by the heroku provided url (<project-name>.herokuapp.com
)
I added a custom domain to Heroku for the api subdomain of my Netlify site api.<base-url>
, the result of my heroku domains
command is:
➜ heroku domains
=== <project-name> Heroku Domain
<project-name>.herokuapp.com
=== <project-name> Custom Domains
Domain Name DNS Record Type DNS Target
api.<base-url> CNAME fitted-lemon-gzwby8exkguturnmh2emy5l4.herokudns.com
And I created a CNAME record on Route53 that points to this Heroku DNS target.
This sort of works, running host api.<base-url>
gives:
➜ host api.<base-url>
api.<base-url> has address 104.248.60.43
api.<base-url> is an alias for <project-name>.herokuapp.com.
api.<base-url> is an alias for <project-name>.herokuapp.com.
So it is aliased to my heroku app, but when I go to api.<base-url>
directly I get a white page that says 'Not Found', looks like this is on Netlify's side not Heroku? But I'm not sure. I feel like I need to tell Netlify somehow that there is a custom subdomain at api.<base-url>
but the only thing I can find in the docs is setting up Netlify's subdomains from other branches of the project, not when a subdomain is hosted elsewhere.
Setting api<base-url>
as a Netlify custom domain just ended up routing all the traffic for api.<base-url>
to the static netlify site at <base-url>
instead of my Heroku app.
I made a few other attempts but nothing has worked so far, I am officially stuck on this. Thank you in advance!