Custom Domain with CNAME and PHX_HOST

Hello, I have a Phoenix app deployed on Fly, I used the CNAME method in this guide Custom domains · Fly Docs to add my domain, but this has caused an issue where when I send emails, they are sent from fly’s domain, because of PHX_HOST = 'nellie-backend.fly.dev'

I though this was straight forward, and I could just change it here, to my domain, but when I do that and run fly deploy I see

WARNING The app is not listening on the expected address and will not be reachable by fly-proxy.achine e82d615b092478 reached started state
You can fix this by configuring your app to listen on the following addresses:
  - 0.0.0.0:8080
Found these processes inside the machine with open listening sockets:
  PROCESS                           | ADDRESSES
------------------------------------*----------------------------------------
  /.fly/hallpass                    | [fdaa:1b:306c:a7b:1ae:12fb:af48:2]:22
  /app/erts-15.1.2/bin/epmd -daemon | 0.0.0.0:4369, [::]:4369

and my app also breaks.

What is the correct way to do custom domains on Fly ?

It looks like your app is actually listening on port 4369, but your TOML config says that you expect it to listen on 8080. Make these the same.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.