Heroku and Cloudflare integration "No such app" - heroku

I have a bit of a hard time getting Heroku and Cloudflare connected. The only other question I could find was here, and it was not particularly helpful since I already created a custom domain entry.
What I did:
Added a custom domain:
Configured the domain like this in Cloudflare, which I believe is correct:
But when I visit my custom domain, I get the
When I visit my .herokuapp.com subdomain, I see:
Any ideas?

The page now magically works, and I have no idea why since I wrote the post when the had been added for over 48 hours.

Related

How to associate Heroku app with a Google domain?

I purchased a domain with Google and I would like to associate it with a Heroku app. What is the step-by-step process to achieve that?
I recently connected my app to a custom domain. Although my domain is purchased from AWS route53. I think the approach generally is the same.
First of all, you can check out this page written by Heroku. https://devcenter.heroku.com/articles/custom-domains
I believe the tutorial given by Heroku works. However, I am tired of all those CLI that make things unvisable XD. Luckily, we can configure it from the Heroku website instead of the CLI.
Here is my approach:
First open your app in the Heroku web page, then click the "Settings" button
https://dashboard.heroku.com/apps/{your app name}
Scroll down until you see the "Domains" section, Then click "Add domain"
https://dashboard.heroku.com/apps/{your app name}/settings
Input the domain name you purchased from google (eg. www.example.com)
After adding your domain, Heroku will give you the DNS target.
From your google domain DNS management page, you should be able to add a new record for your hosted zone.
Finally, add a new record with simple routing policy, type CNAME, and value equals to the DNS target provided by Heroku.
It is really simple if you follow these steps correctly. Due to my reputation level, I cannot upload photos. Feel free to contact me if you want some image to guide you how to locate the buttons :)
It’s only 3 steps:
1. Heroku, in your app > Settings > Add your domain:
Add www.[foo.com] (Note: www is KEY!) to your app
Copy the [DNS Target] it gives you
2.Google Domains > DNS > Resource records > Custom Records > Manage Custom Records:
www, CNAME, [DNS Target]
Now you’re basically set up. If someone goes to https://www.[foo.com] in a few minutes, they’ll see your Heroku app hosted at [DNS Target]. But if they go to any other permutation (http, non-www) they’ll get a 404 error. To solve this, we’ll set up permanent redirects to the main version in the next step.
Google Domains > Website > Add a Forwarding Address:
From Field: [foo.com]
To Field: https://www.[foo.com]
Permanent Redirect (301)
Forward Path (so that [foo.com]/about forwards to https://www.[foo.com]/about)
SSL Enabled
Boom. Wait a couple of minutes for DNS to catch up, and you’re done.
heroku certs:auto:refresh
In Terminal refresh the SSL cert settings on Heroku, and check the Heroku Dashboard to confirm everything’s working.
Confirm all the below permutations forward to your site correctly:
https:
https://www.[foo.com]
https://[foo.com]
http:
http://www.[foo.com]
http://[foo.com]
paths:
https://www.[foo.com]/about
http://[foo.com]/about
PS: So does this work for the naked domain like [foo.com] instead of www.[foo.com]? No! Google Domains does not support ALIAS domains, and therefore in combination with Heroku does not support forwarding to the naked (aka. root aka. apex) domain. Sorry! This surprised me too :( Source 1: Heroku Docs | Source 2: StackOverflow. Your only alternative here is to transfer your domain (which costs money) to something like Cloudflare.
A working answer with these explanations is taken from https://nikodunk.com/heroku-ssl-google-domains-2019/
Just to add to Fergus's answer, if you are seeing the warning "cant add cname records as root domain" add www to the host name input.

Website not working on root domain with https

I am trying to deploy a NextJS website to Heroku or Vercel and add a domain name to it using https://www.names.co.uk.
Adding the domain works but for some reason I cannot access the website at https://my-website.com, however I can access it with http://my-website.com and https://www.my-website.com. I need it to work for this url 'https://my-website.com' as the website is already ranked in google with this URL. I was wondering if anyone had any idea of how this can be done. Please ask if you need more information.
Apologies if I have posted this in the wrong place.
Thanks in advance.

Custom google-domain for heroku app causes IP/DNS address error

I have a heroku app hosted at https://rosalinep.herokuapp.com/ that I'm trying to move to the address www.rosalinep.com. (I'm not picky about redirections from rosalinep.com or https vs http, I just want to have this website launched without 'herokuapp' in the url right now.) I used Google Domains to get the domain rosalinep.com, and used the following configurations:
On Google Domains:
synthetic records image
custom resource records image
On Heroku:
domains image
Last night when I first tried to launch this, it worked, but this morning I'm seeing the following error page (which is a total bummer...):
broken website image
Running 'heroku domains' confirms www.rosalinep.com is in the app's custom domains.
I did some searching to try and fix this problem, and it looks like some people in similar situations have reported success in using CNAME like I used, but Heroku's documentation seems to say that an ALIAS or ANAME is necessary for root domain configuration, and those options are apparently not supported by Google Domains.
Because of how Heroku works, they do not release the IP addresses of the apps you create on it, so I can't directly feed it an IP address.
I've gotten pretty stuck and confused in trying to resolve this. Any info on whether I can get this working with Google Domains would be greatly appreciated. Also, if it can be helped, I'd like to not pay for any additional services.
If Google Domains is a non-starter for this though, well, I'm open to other Domain registration websites.
Fixed it! :) After all that, it was just four characters that caused all this headache...
The issue was that in the Google Domains custom resource records section, in the Data field I had 'www.(dns_data_here).com.' when it should have '(dns_data_here).com.'
The site is now up and running on the new url!

Custom Domain With Heroku with a CNAME record - not working

I used the heroku guide to setting up a custom domain to set up a custom domain for a Heroku app, however, the custom CNAME record I set up at Dreamhost isn't working correctly. The website for my app (myappname.com) shows the Heroku page that says "There's nothing here, yet".
Here's what I used per the Heroku guide:
CNAME record at Dreamhost:
record: www
type: CNAME
Value: myappname.com.herokudns.com
In my Heroku settings this is what shows as the target DNS:
myappname.com.herokudns.com
This is my first time setting up a custom domain with Heroku so I'm not sure whats going wrong. I looked at all of the similar questions here and read some guides online too. Should I change the DNS record to "myappname.heroku.com"?
I should note the heroku app is on the free tier so there is no SSL.
For future reference, if anyone else makes the same silly mistake I made, make sure your DNS target at Heroku includes the correct subdomain ('www' in this case).

My heroku app redirects to another site

this week one of my client sent me an email saying that the url of the heroku's app was redirecting to another site myapp.com/index.cfm?fa=main.tradelogin. The name of this site is Pressgeek.com.
But if I use myapp.herokuapp.com it works fine. I checked my github repo to see if there was some redirect there but I didn't find any. I also checked the heroku's settings and there were ok.
I never had a problem like this, someone know what to do? Thanks

Resources