Best practices for starting http and https combined?

45 views
Skip to first unread message

al...@lunabyte.io

unread,
Jul 30, 2016, 2:14:40 AM7/30/16
to elixir-lang-talk
Should I use the http and https methods, both pointing to the same plug, should I create two different children using the child_spec function twice, or is there a way to do both under one child?

Additionally, if I wanted to redirect http traffic to https using Plug.SSL, would I want to start both http and https?

Thanks

al...@lunabyte.io

unread,
Jul 30, 2016, 3:12:30 AM7/30/16
to elixir-lang-talk

Sorry, meant to specify this is for Plug alone, not Phoenix or anything.

José Valim

unread,
Jul 30, 2016, 4:03:41 AM7/30/16
to elixir-l...@googlegroups.com
Yes, two child specs is the way to go since you end up using a different acceptor on a different port.
--
You received this message because you are subscribed to the Google Groups "elixir-lang-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-talk/c2bbaa19-e8be-4da5-a873-98d59d47830e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--


José Valim
Skype: jv.ptec
Founder and Director of R&D

al...@lunabyte.io

unread,
Jul 30, 2016, 4:09:28 AM7/30/16
to elixir-lang-talk
Thanks very much José :)


On Saturday, July 30, 2016 at 3:03:41 AM UTC-5, José Valim wrote:
Yes, two child specs is the way to go since you end up using a different acceptor on a different port.

On Saturday, July 30, 2016, <al...@lunabyte.io> wrote:
Should I use the http and https methods, both pointing to the same plug, should I create two different children using the child_spec function twice, or is there a way to do both under one child?

Additionally, if I wanted to redirect http traffic to https using Plug.SSL, would I want to start both http and https?

Thanks

--
You received this message because you are subscribed to the Google Groups "elixir-lang-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-talk+unsubscribe@googlegroups.com.

Александр Сальников

unread,
Jul 30, 2016, 1:14:39 PM7/30/16
to elixir-lang-talk
If you want to have a truly native approach then i hope you have had an answer. But probably you just want to set up haproxy or nginx frontend before your application that will upstream all the requests to your phoenix application as a http only request and serve them from a single phoenix endpoint. I think that is a very common practice if we are talking about nginx as a front-end

суббота, 30 июля 2016 г., 9:14:40 UTC+3 пользователь al...@lunabyte.io написал:
Reply all
Reply to author
Forward
0 new messages