Custom Domain "Not Found" - heroku

I have the frontend hosted on Netlify and I also bought my domain there. Now I am trying to add the same domain to my backend that's hosted on Heroku, but I keep getting "Not Found" on the website I set. (I have my frontend on mydomain.com, and would like to have the backend on api.mydomain.com or mydomain.com/api/)
What I did:
Through Heroku CLI used the command "heroku domains:add www.mydomain.com" - That worked fine
I copied the "abunchofstuffhere.herokudns.com" that I got from the previous command and added it into the Netlify DNS through a CNAME, putting the name to "api" and value to "abunchofstuffhere.herokudns.com", as it said on the Heroku docs.
Now, I'm not sure, if that's all I have to do or if I did something wrong there already, but it definitely isn't working.

If you want to host api.mydomain.com on Heroku, you need heroku domains:add api.mydomain.com. Not www.

Related

Heroku app custom domain points to empty root

I've set up my app on Heroku. Everything loads fine when I access the herokuapp.com domain.
I've added my own domain to the app and added the CNAME as instructed but when I go to the subdomain it's just showing an empty root.
I'm not sure what I am doing wrong here!
I've checked the domain is added to the app running heroku domains in terminal and it's there.
This is the first time I've published an app on Heroku but I've followed the instructions and I can't see what the problem is.
Any help is much appreciated.
Thanks
I managed to resolve this issue by adding another CNAME record in the domain provider account and creating the subdomain in there, rather than from the server.

Getting 'Not Found' on custom subdomain on Netlify site. Using Route53 with Netlify and subdomain hosted on Heroku

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!
Found it! Figures that it would click 30 minutes after posting.
I had a CNAME on Route53 but this was useless since I was using the Netlify DNS. You'll need to create a CNAME on Netlify that points to the host Heroku gives you.
So my heroku domains gave me the host I needed the CNAME to point to. I created a CNAME record on Netlify - which was not very obvious, I had to click into the badge 'Netlify DNS' in order to find the config.
I was able to create the right CNAME and then have it all work after that.

Deployed heroku app not showing up on custom domain

I set up a custom domain for my heroku app, which worked ("Theres nothing here, yet").
I then deployed my first version of the app to heroku and tried to access it via the custom domain, but still got the message "Theres nothing here, yet".
The deployment was successful and the app can be reached via appname.herokuapp.com.
How do I get it to show up on my custom domain?
I had the same issue this morning but managed to resolve it.
I added my custom domain via the settings menu of the heroku dashboard (web page) and then added the heroku DNS target to a CNAME record with my DNS provider (GoDaddy). After just a few minutes the DNS target URL was pointing to the purple "There's nothing here, yet" page. 10 or 15 minutes later my custom domain name was also pointing there, but no sign of my app.
Researching the issue led me to your post and also to https://support.dnsimple.com/articles/heroku-error-nosuchapp/
Following the instructions at the bottom of the page I used the heroku command line to add a 'www' version of my custom domain.
heroku domains:add www.example.com
Immediately after this my app showed up at my custom domain. I didn't even need to add the 2nd DNS target to my DNS provider. It just worked.
Curiously, pointing my browser directly at the DNS target URLs does not work.

Google Domains Not Pointing to Correct Heroku App

I am trying to point my Google Domains domain name to Heroku, but am having a hard time. I previously had the domain forwarded to point to another website, but I have now followed these instructions to point it to my Heroku app.
The domain in question is www.lizbayardelle.com. The Heroku app I want it to is https://liz-bayardelle.herokuapp.com/. If I type heroku open in Terminal this is what comes up. However, if you go to the domain and the heroku app, the domain still shows the other website (to which it was initially forwarded), not the Heroku app.
Here are my Google Domains settings:
If you want it to point to liz-bayardelle.herokuapp.com, use that.
You've used www.liz-bayardelle.herokuapp.com. Visiting that URL displays Heroku's "no such app" page.
It turned out that the domain name was still "claimed" by the other Heroku app, so I had to log in to the one which had been forwarded on the Heroku console and delete the domain name. After I did this it could be added with heroku domains:add www.lizbayardelle.com and heroku domains:add lizbayardelle.com.

When my CNAME record redirects to my heroku app, it says there is no such app.

My app works fine on tradespring.heroku.com (I think. Well I can see it perfectly anyways). So I entered a CNAME record that redirects my domain(tradespring.net) with alias www to tradespring.heroku.com. But then when I enter www.tradespring.net it says heroku app not found.
When I just enter tradespring.heroku.com it works fine though. It does automatically change it to https://tradespring.heroku.com though. Why doesnt it work through the CNAME
heroku domains:add www.tradespring.net
It is because the CNAME entry is redirecting to heroku but asking from "tradespring.net" for heroku. And that is ok, it should work this way. Now I supose you have to configure heroku in to respond request to your domain.
Here is the tutorial for heroku custom domains:
https://devcenter.heroku.com/articles/custom-domains

Resources