I made a post before 1 Gigalixir instance hosting multiple HTTPS sites
but I am still not understanding how can I support https. The multi_proxy config was a little bit difficult, but I think as long as your endpoints do not specify a port and they let multi_proxy define the port, it works. But if you have https, I do not see what options are needed (or maybe, it isn’t needed?)
config :master_proxy,
http: [port: 80],
# http: [port: String.to_integer(System.get_env("PORT", "4000"))], # <--- is this better?
# https: [:inet6, port: 443], # <--- this causes an error. How to specify a local cert?
backends: [
%{
host: ~r{^(www\.)?myapp\.com$},
phoenix_endpoint: MyAppWeb.Endpoint
},
]
If https
is uncommented, it gets this error:
(ArgumentError) could not start Cowboy2 adapter, missing option :key/:keyfile
but I do not understand how to fix this in dev.
Also I do not understand whether master_proxy should be listening on port 4000 (the PORT), or if it should be listening on port 80.
Thank you sorry I am confused