vrod
Gigalixir config not supporting SSL?
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!
Most Liked
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.
Last Post!
LostKobrakai
If you’re just doing redirects you can also see if you can do the redirect to the www.* version at the dns level using GoDaddy.
Popular in Questions
Other popular topics
Latest Phoenix Threads
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #hex
- #security









