Mitkins
Mitkins

Reputation: 4341

Phoenix Framework/Gigalixir - redirect to https

I have an Elixir app on Gigalixir. Here's my current configuration:

config :zoinks, ZoinksWeb.Endpoint,
  load_from_system_env: true,
  server: true,
  secret_key_base: "${SECRET_KEY_BASE}",
  url: [scheme: "https", host: "sqrnut.gigalixirapp.com", port: 443],
  cache_static_manifest: "priv/static/cache_manifest.json"

However, when I go to http://sqrnut.gigalixirapp.com it's listening on port 80. I've tried adding the following - force_ssl: [rewrite_on: [:x_forwarded_proto], host: nil]. But I think this is something to do with configuring cowboy for ssl - which I'm trying to avoid.

Am I missing something? Can I redirect the url to work with the load balancer on Gigalixir without configuring ssl?

Upvotes: 1

Views: 494

Answers (1)

Jesse Shieh
Jesse Shieh

Reputation: 4850

the redirect seems to work when I visit http://sqrnut.gigalixirapp.com/

Were you able to get this working or do you still need help?

Fwiw, force_ssl should be the right option for this.

Upvotes: 1

Related Questions