vrod

vrod

I have Phoenix app what still has some trouble with SSL. From Using Mix — GIGALIXIR 1.4.0 documentation I try using that config, but I observe the following behaviours:

http://myapp.com --> redirects to https://www.myapp.com  ok
http://www.myapp.com --> redirects to https://www.myapp.com ok
https://www.myapp.com --> works ok no redirect
https://myapp.com --> Potential Security Risk ahead!!!

The domain is DNSed at GoDaddy. The domain has “forwarding” to http://www.myapp.com but I am not sure what this means. I add CNAME to gigalixir for www and root domain:

gigalixir domains:add www.myapp.com
gigalixir domains:add myapp.com

But GoDaddy does not permit root level CNAME. I think this is problem?

Also I am not understanding why does the example config say port 443? Am I understanding this correctly that Gigalixir listens on PORT? So why does the example config say 443 and both http and port 443?

config :my_app, MyAppWeb.Endpoint,
  http: [port: {:system, "PORT"}], # Possibly not needed, but doesn't hurt
  url: [host: "${APP_NAME}.gigalixirapp.com", port: 443],
  secret_key_base: Map.fetch!(System.get_env(), "SECRET_KEY_BASE"),
  server: true

The DNS also uses A record, but I think this is incorrect.

Is it possible to get HTTPS for both www and root level domain with GoDaddy? Or do I need to find DNS with ALIAS feature? Is there something wrong with my config copied from example doc?

Many thanks!

Showing Posts 1 to 10

unsek

unsek

I ran into this issue in the past as well. This might not be helpful but I just transferred the domain to NameCheap and set the value to @ for root level domain.

mgwidmann

mgwidmann

I don’t have it configured with a custom domain but mine works fine with the standard given name. Doesn’t your url configuration have to be the custom domain name, not the gigalixirapp.com name?

App here:
https://options-tracker.gigalixirapp.com/
Code here:
https://github.com/mgwidmann/options_tracker/

vrod

vrod OP

Thank you but my configuration still does not work I think. When custom domain is added, there is no example in the documentations for what the config must be. Is gigalixir domains:add alone enough?

I am still confused. From previous post, I am understanding that Gigalixir forwards requests and our apps must only listen on PORT… but why do some examples also listen on 443? I feel that this example of custom domain configuration is very much missing from the doc page or maybe I cannot find it?

also maybe GoDaddy is not possible to use with Gigalixir for custom domains?

LostKobrakai

LostKobrakai

config :bob_versions_web, BobVersionsWeb.Endpoint,
  http: [:inet6, port: System.get_env("PORT") || 4000],
  url: [scheme: "https", port: 443],
  force_ssl: [rewrite_on: [:x_forwarded_proto], host: nil],
  …

This one works for me with the internal as well as a custom domain.

vrod

vrod OP

Thank you, I tried this confi but still I have security warnings when I try https requests for the root domain:

both www and root domains are defined in gigalixir.

LostKobrakai

LostKobrakai

Can you look at the served certificate if it actually holds your domain names?

vrod

vrod OP

I think I found a clue. The trailing slash seems to be very important! At least with Firefox. Chrome seems to have problems with or without:

https://myapp.com --> redirects to https://www.myapp.com OK
https://myapp.com/ --> redirects to https://myapp.com  Warning: Potential Security Risk Ahead!!!

The certificate seems Ok for www.myapp.com – it says Let’s Encrypt and for “Subject Alt Names” it shows www.myapp.com

But when I get the “Security Risk” error, I inspect the cert and I see that Common Name

and the DNS names are for shortener.secureserver.net

Maybe this is the GoDaddy “redirect”?

vrod

vrod OP

I removed the GoDaddy forwarding (it forwarded http://myapp.com to http://www.myapp.com) and now I get a new error when I request https://myapp.comPR_END_OF_FILE_ERROR

LostKobrakai

LostKobrakai

If the certificate is only valid for www.myapp.com then myapp.com is correctly insecure.

vrod

vrod OP

But this is what gigalixir is supposed to supply I thought. I have added both domains to gigalixir domains.

Where Next? Top

Trending in Questions Top

Blokh
Hey guys, I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly Do you guys have any suggestions what is the best prac...
New
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
Onor.io
I have what I’ve heard referred to as a “lookup table” in my database. This is a way of assigning codes to common values. One common lo...
New
jaybe78
Hello, I’m developing a online persistent chat system (what’s app) like using elixir/dynamodb/aws for a mobile app(flutter). The diffic...
New
Trolleger
What approach to take when sending live updates to “random” users Hi! I have a question, I have a little chat app, and when I create a DM...
New
matt-savvy
Anyone here using Honeybadger? My Honeybadger account is being overwhelmed with noise from some bots. Seeing a lot of Bandit.HTTPError...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New

Other Trending Topics Top

garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
wintermeyer
There are three potential reasons for members of this forum to have a look at https://vutuv.de You are tired or annoyed of LinkedIn. Yo...
New
webofbits
Aludel - LLM Evaluation Workbench Aludel is an embeddable Phoenix LiveView dashboard for evaluating and comparing LLM prompts across mult...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews