Home > Net >  Godaddy domain registrar, Nginx listening on 443 and not accepting connections from hostname, direct
Godaddy domain registrar, Nginx listening on 443 and not accepting connections from hostname, direct

Time:12-10

The Problem

Whenever I connect to my website via the direct ip, example: "https://my-ip" the website loads fine. My DNS is pointed towards "https://my-ip" as well. I am running nginx serving a react frontend and reverse proxying HTTPS calls into HTTP calls to my Django backend. However attempting to connect to my website via the hostname, example www.mywebsite.com fails with a 404, which you can see by attempting to connect to www.holdengjuka.com. My domain registrar is godaddy. I am using a self-signed security certificate (LetsEncrypt).

CodePudding user response:

Using Martheen's advice, I created an A certificate on GoDaddy.com pointing to my IP, using these instructions: https://www.godaddy.com/help/add-an-a-record-19238. I used a wildcard for the domain name, e.g: *.mywebsite.com

I then used the following tutorial to create a LetsEncrypt certificate: https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-22-04 and ran into a problem where it failed to create a certificate:

"Certbot failed to authenticate some domains (authenticator: nginx)."

Since I had manually configured the NGINX configuration to enable SSL already for the site, it couldn't make a certificate. So that problem was that I needed to make the website accessible by HTTP, and the method in the tutorial then automatically configures it to become an HTTPS site. Now the site is served fine over HTTPS! Thanks again Martheen, wish I could upvote you but my account is too new it seems.

UPDATE: I had further problems with GoDaddy and A records, I had to delete my A record that looked like this: [A @ Parked] and add these records: [A @ my-ip] and [A *holdengjuka.com my-ip] where my-ip is my actual IP.

Additionally, you must delete ALL Domain Forwarding in the Domain Forwarding section. You should be able to get to your website using your domain name with only the addition of A records and the removal of that "Parked" A record. Also it may not appear to update on your end if your DNS or browser still has your website cached, so go to your website using the full URL, e.g https://www.holdengjuka.com, to figure out if your website is being served properly. Alternatively you can also use the curl command on linux. Example curl www.holdengjuka.com

  • Related