Custom domain

I have set up a custom domain for my app using A records according to the docs:

When I write my domain name in the browser it loads my app but the URL address quickly switches back to * domain. What am I missing?

Hey! Can you send your app name here or in DM? Thanks.

Thanks. What’s the domain? and

OK, so this works for me But redirects. What’s your application built in? This looks like a ‘force TLS’ type redirect that some frameworks enable by default.


This is just a guess, but do you have a config that looks something like this?

config :hello, HelloWeb.Endpoint,
  url: [host: ""],
  force_ssl: [rewrite_on: [:x_forwarded_proto]]

If so, the host set here will be used for the target of the SSL redirect. To use the current host instead, change force_ssl to:

force_ssl: [rewrite_on: [:x_forwarded_proto], host: nil]

Thank you. I will check that

Once again thanks. That solved the problem:
force_ssl: [rewrite_on: [:x_forwarded_proto], host: nil]

1 Like

Hi, can you help me too.
My app - wandering-fire-179 and pointing to
The problem is, it does not finish fetching

@dev-rroslan I’m hitting and getting a full response — do you have a little more information? Do you mean one of the secondary requests is taking too long? Or is the site not loading for you at all?

It’s ok now. added check_origin in rentime.exs

Note: This solution…
force_ssl: [rewrite_on: [:x_forwarded_proto], host: nil]
… also fixes the LiveView infinite refresh problem described in Phoenix LiveView constantly refreshes with custom domain - #10 by stibbs . However this solution solves the endpoint issue in that link as well.

Also note: I noticed this URL redirect problem in Chrome but not Edge!