I’m having socket reconnection issues sometimes on reconnect, refreshing usually fixes this. Looking at the logs, my phoenix app sometimes is receiving an ip address instead of a domain as the host in the “conn”. I am parsing the host of the conn and routing based on subdomain so this causes issues.
eg. :erlang.binary_part(“127.0.0.1”, 0, -3) instead of :erlang.binary_part(“sub.domain.com”, 0, -3)
Are you rewriting based on x-forwarded-for? We don’t do this by default in Phoenix so it’s possible some clients are sending the Host header differently.
Ensure this is in your endpoint config for prod. Note that host: nil will dynamically redirect to the host of the current request, which is probably want you want here if you have different subdomains:
ah, the other thing to look at is fly dedicates ipv4 addresses to your app (fly ips list) so it’s possible the logs you are seeing are not related to the “issues sometimes on reconnect”, but instead someone crawling the ipv4 address space and hitting your app at the same time?