Domain works with www, but not without the www

I am hosting a nodejs server with a static site in a docker container on fly.io.
I own a domain that i purchased through hover.com, and i set up the DNS records as such:

However, although https://www.mydomain.com works, http://mydomain.com works, but https://mydomain.com/ doesn’t.

I get:

This site can’t be reached

poshfob.com unexpectedly closed the connection.

Try:

ERR_CONNECTION_CLOSED

@user84 Does the your Fly dashboard give you the green light on your certificate DNS validations? That _acme-challenge entry doesn’t look complete to me — I would have thought you’d need two entries there for _acme_challenge.www.mydomain.com and _acme-challenge.mydomain.com for all your URLs to work correctly.

Sorry i mean to reply to my own… i had a cert for *.mydomain.com, but i also needed one for mydomain.com. Honestly not sure why that fixed it but it did!

1 Like

Although now im struggling how to get http to auto-redirect to https when i am deploying a static site?

Is this still the nodejs app you’re referring to? If it is you’d probably want a middleware that checks the protocol and redirects if it’s http. But this will need to be some kind of behaviour change either way.