niccolox

niccolox

Umbrella apps with plug ssl

is it possible to have an Umbrella App in Phoenix 1.4-dev that has multiple domains assigned to SSL in Plug

i.e.
web_app_1 web_app_1.com 8443
web_app_2 web_app_2.com 8444

I need to setup firewall rules to forward 443 to 8443 AND 8444

this seems impossible?

Most Liked

idi527

idi527

:waving_hand:

Maybe you can have two Web.Endpoint with each with it’s own domain/port to bind to? You can achieve this by having either two phoenix apps in your umbrella, or by adding a “proxy” phoenix (or plug / cowboy) app which would reroute the request further “into the umbrella” based on the domain/port pair.

An easier way would be to just start two supervisors for the endpoints:

# in the <your_phoenix_app>/application.ex
# in start(_, _)

children = [
  supervisor(Web.Endpoint1), # binds to 8443
  supervisor(Web.Endpoint2) # binds to 8444
]

with both of them calling the same plugs.

Where Next?

Popular in Questions Top

nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New

Other popular topics Top

rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New

We're in Beta

About us Mission Statement