HTTPS not working for domain, but works for subdomain - https

I've got a subdomain set up for my nextcloud instance at nc.example.com, and I have set up a new virtual host for my main website that I will look at creating at example.com. I ran certbot on example.com, and initially it worked, then I accidentally ran certbot again, but ctrl C'd out of it, but now HTTPS on example.com does not seem to work, even though when I run certbox certificates, it's listed there.
Initially example.com would work, but now it will only work when I include www., but it's running on a HTTP connection.
My nc.example.com works fine with HTTPS and no www., in my DNS records I've added an A record pointing to 174.129.25.170 to fix the naked domain issue with having to include www., but as I mentioned, it was working briefly and now it's not.
A Record Entry
I feel like I've just messed something simple up cause it was working initially. Any assistance would be appreciated because I'm still learning this stuff. I'm running apache2 on an Ubuntu 22.04 AWS EC2 instance.
Cheers

My apologies, I fixed this literally 3 minutes after posting this.
I ran sudo certbot
and it asked which names I'd like to activate HTTPS for, it listed three domains
example.com
nc.example.com
www.example.com
I selected 3, and it seems to have fixed my problem, but now I have 3 certificates, will this matter?

Related

How to find out where my website is hosted

I've looked at this answer and it doesn't solve my problem.
I just switched to a new site builder. Previously I was using Kajabi. Now i'm using GroovePages (GP). I switched DNS Settings in GoDaddy to GP's custom DNS servers, but now I am seeing 2 different websites when I go to the WWW version and the NON-WWW version of my website. The NON-WWW is correctly showing the page i built on GP, whereas the NON-WWW is not.
To make a long story short, I've been through long email threads with each company and seems like neither one knows how/why the WWW is not properly routing to the new site. GroovePages claims they have proper CNAME record set, as they are the ones managing the DNS records. Kajabi claims to have reset any lingering records also.
Currently the WWW version is pointing to Heroku, but I don't even have a Heroku account and haven't used them to host my website.
How do I fix this problem?
You need to make sure when you setup Forwarding that you forward to www.mysite.com instead of mysite.com
Link to forward my domain: https://in.godaddy.com/help/forward-my-domain-12123

Heroku and GoDaddy DNS configuration

I have been struggling to configure my Heroku to point to my domain name registered with GoDaddy.
I've setup my Heroku domain:
And I've configured my CNAME www to point to www.ithhero.com.herokudns.com
So far all tutorials/examples I've seen have had a different DNS target e.g. www.ithero.herokuapp.com . And even though I have followed the steps no results have been yielded. Godaddy and Heroku have been bouncing responsibility between them when raising an issue with either.
What am I doing wrong?
You postet it a while ago so I assume you found a solution already, but you should only change your CNAME value from:
www.ithehero.com.herokudns.com
to
ithehero.com.herokudns.com
This is definitely an issue on GoDaddy.
If you try the following, you can see that the domain has been setup correctly from Heroku's side:
curl -v -H "Host: www.ithehero.com" www.ithehero.com.herokudns.com
Also, if you check your DNS resolution, your CNAME's haven't been propagated at all: https://www.whatsmydns.net/#CNAME/www.ithehero.com
I would go back to GoDaddy and get them to have a look at this.

DNS Problems with Heroku

I'm having some problems configuring the DNS settings for my custom domain to work correctly on Heroku.
I have set the DNS records as follows:
Host Type Points to
example.com WR www.example.com
www.example.com CNAME example.herokuapp.com
www.example.com.au CNAME example.herokuapp.com
However, the 'www.example.com' domain sometimes fails to load on my computer, as well as my client's phone. It seems rare for this domain to fail (it works fine on everyone else's computers that I've asked), but the fact that it doesn't work on mine and my client's computers is a problem.
However, the '.com.au' domain (and the heroku one) always works. Why is this?
Is there anything wrong with the configuration above? I followed the 'custom domain names' article on heroku to reach this configuration (I don't have much experience with DNS, unfortunately). The DNS provider I am using does not support ANAME or ALIAS so I went with the above config instead.
Thanks. Any help in getting the '.com' domain working on every device would be appreciated.
I'm not really sure, it may be a lot of things, DNS caching and other stuff.
But if you don't have a lot of DNS records, I suggest you use a heroku add-on like PointDNS (https://addons.heroku.com/pointdns) as it supports ALIAS.

Production redirect loop error on root domain, but not with www

I'd like when a user types the domain YOURSITE.com to not go into a loop and crash. I've searched for answers for a couple days now and can't seem to find the exact one.
Error from chrome: This webpage has a redirect loop - The webpage at http://YOURSITE.com/ >has resulted in too many redirects. Clearing your cookies for this site or allowing third->party cookies may fix the problem. If not, it is possibly a server configuration issue and >not a problem with your computer.
Background:
Rails 3.2.14 App with Ruby 2.0.0
Domain bought with godaddy
Hosting on Heroku with both domains setup www.YOURSITE.com and YOURSITE.com
Using AWS with route 53 and S3.
Let me know what relevant code you need to help or if this is something that is being caused by AWS or the like. I've tried an reversed several different things via my code, but can't seem to find anything that works.
you should log into your Heroku dashboard, click on the app and then click on the "Production Check" button. This will help you check for DNS issues among other.
Check your DNS Zone file with godaddy. How are you redirecting the sub domain www to the host domain?
On your rails app, how is your route.rb file handling the incoming traffic? do you have any redirection there?
Hope that helps..
There is a very good write up that goes through configuration settings between AWS, the domain registrar (in my case godaddy), and heroku here: https://devcenter.heroku.com/articles/route-53#naked-root-domain I used this originally when I set up my site.
I wish I could say I know what the problem was, but I'm not totally sure what it was. My guess is that it had to do with APEX domains being unsupported by AWS and/or Heroku, and therefore I needed not to try to redirect. Here's the settings that worked for me:
Godaddy domain mysite.com, transferred my DNS stuff to AWS (I had done that prior to the problem)
Heroku: you can either use the CL or you can access the settings for your app online. In either situation I set up my domains to be mysite.com and www.mysite.com
AWS: This is a little trickier. You need to make sure the settings for Route 53 and S3 are exactly like in the tutorial link above. Your mysite.com bucket in S3 must redirect to www.mysite.com.
This isn't ideal and there are probably ways to get around this using different companies for hosting/DNS services, but with the Heroku/AWS combo this is what I had to do to stop the redirect loop.

Domain setup on DreamHost to Heroku

I am moving my rails applications form DreamHost to Heroku.
Name servers are still on DreamHost.
Here's how I set up:
www.mydomain.com: CNAME to mydomain.herokuapp.com
mydomain.com redirected to www.mydomain.com
This sort of works.
But mydomain.com/admin doesn't work.
I must go to www.mydomain.com/admin.
How can I make mydomain.com/admin work?
Thanks.
mydomain.com is forwarded to www.mydomain.com correct? Then mydomain.com/admin wont work, everything mydomain.com is forwarded.
If you want this behavior then you need to remove your forwarding at the DNS and do this kind of redirection (or not) at the application level.

Resources