Custom domain

Hello
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 *.fly.dev domain. What am I missing?

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

rough-sky-1538.fly.dev

Thanks. What’s the domain?

nentech.pl and www.nentech.pl

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

Elixir/Phoenix

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

config :hello, HelloWeb.Endpoint,
  url: [host: "example.com"],
  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 https://undionline.com
The problem is, it does not finish fetching

@user22 I’m hitting https://undionline.com 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