This is an excerpt from the logs in my fly dashboard. Including them here in case it helps someone else find the solution in future
[error] Could not check origin for Phoenix.Socket transport.
[info] Origin of the request: https://www.rafo.com.au
[info] This happens when you are attempting a socket connection to
[info] a different host than the one configured in your config/
[info] files. For example, in development the host is configured
[info] to "localhost" but you may be trying to access it from
[info] "127.0.0.1". To fix this issue, you may either:
[info] 1. update [url: [host: ...]] to your actual host in the
[info] config file for your current environment (recommended)
[info] 2. pass the :check_origin option when configuring your
[info] endpoint or when configuring the transport in your
[info] UserSocket module, explicitly outlining which origins
[info] are allowed:
[info] check_origin: ["https://example.com",
[info] "//another.com:888", "//other.com"]
This was an easy fix in the end (thankfully).
I had forgotten to update my Elixir apps config when I swapped to my custom domain. I.e. runtime.exs
needed to be updated to reflect my custom domain as the host.
If you follow Build, Deploy and Run an Elixir Application you’ll have something like below in your config/runtime.exs
config :rafo, RafoWeb.Endpoint,
url: [host: "#{app_name}.fly.dev", port: 80],
http: [
ip: {0, 0, 0, 0, 0, 0, 0, 0},
port: String.to_integer(System.get_env("PORT") || "4000")
],
secret_key_base: secret_key_base
This needed updates to become:
config :rafo, RafoWeb.Endpoint,
url: [host: "rafo.com.au", port: 443], # host + port change
http: [
ip: {0, 0, 0, 0, 0, 0, 0, 0},
port: String.to_integer(System.get_env("PORT") || "4000")
],
secret_key_base: secret_key_base