After following the steps in the "Get certified" section, the website was crashing and the cause was not obvious in the server logs. I needed lots of web searches to get this to work. There is a Fly Custom Domains and SSL Certificates guide but it wasn't helpful and just confused me more.
The cause of the crashes was needing to change PHX_HOST in fly.toml to my custom domain name, which I don't see documented anywhere on Fly. Apparently I also needed to set check_origin and force_ssl in config/prod.exs, which doesn't seem to be documented on Fly either. This forum post finally helped me by providing an example of a prod.exs file I could cargo cult.
Since this is specific to Elixir Phoenix, maybe a new guide should be added to the Elixir Getting Started section.
I found an issue with this document.
Title: Use a custom domain Location: https://fly.io/docs/networking/custom-domain/#get-certified Source: https://github.com/superfly/docs/blob/main/networking/custom-domain.html.markerb
Describe the issue
After following the steps in the "Get certified" section, the website was crashing and the cause was not obvious in the server logs. I needed lots of web searches to get this to work. There is a Fly Custom Domains and SSL Certificates guide but it wasn't helpful and just confused me more.
The cause of the crashes was needing to change
PHX_HOST
infly.toml
to my custom domain name, which I don't see documented anywhere on Fly. Apparently I also needed to setcheck_origin
andforce_ssl
inconfig/prod.exs
, which doesn't seem to be documented on Fly either. This forum post finally helped me by providing an example of aprod.exs
file I could cargo cult.Since this is specific to Elixir Phoenix, maybe a new guide should be added to the Elixir Getting Started section.
Addtional info
N/A