superfly / docs

Apache License 2.0
102 stars 1.06k forks source link

Missing instructions for Elixir Phoenix in the "Use a custom domain" doc #1677

Open m1foley opened 4 months ago

m1foley commented 4 months ago

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 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.

Addtional info

N/A

andie787 commented 4 months ago

@jeregrine what do you think?