Domain works with www, but not without the www

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

However, although works, works, but doesn’t.

I get:

This site can’t be reached unexpectedly closed the connection.



@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 and for all your URLs to work correctly.

Sorry i mean to reply to my own… i had a cert for *, but i also needed one for 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.

I have the opposite of this persons problem. I have a custom domain working at, but I want it to work with the “www” as in "". So I want both to work.

• Running a Phoenix 1.6 application with Postgres
• I have everything running with very little configuration. So far so good.


  1. Does my Phoenix or Elixir application need to be configured to interpret “www”?

  2. Do I need to add anymore information to my DNS provider so that if someone types “” it will be directed to. Right now “” works but I want “www” to work.

  3. When I ping “” I get a response but when I ping it with “” it doesn’t work.

  4. Do I need to create 2 SSL certificates? Example A vs Example B

Example A - in this example I have the wildcard in quotes
flyctl certs create
flyctl certs create “*”

Example B - in this example I have but not in quotes
flyctl certs create
flyctl certs create

I have run this command so far.
flyctl certs create

The example here says it’ll be like in A for using wildcard, i.e, with quotes.

I think I figured out how to get it working. I had to refresh myself on the differences between CNAME vs A Records


At this point wait until things have propagated 5 - 15 minutes.

You will know things are working because your certificates are valid and you should be able to visit your custom domain at without the www.

My Understanding
Here is a screenshot of what my final records and record types looks like. (The value column has dummy data but the entries should help anyone understand how the records could be set up.)

Everything highlighted are the records I had to add from the flyio steps mentioned in the steps above (2 A Records, 1 AAA Record, 2 CNAME Records)

In order to get it to work with the www you need to create a CNAME record that points to your root domain. Most of my problem was a result of the CNAME | WWW | record not containing the value of my root domain

If anything looks incorrect let me know. Hopefully this helps anyone.

Verifying through the terminal

> host is an alias for has address

> host has address
1 Like