@BrightEyesDavid I’m not very familiar with the forward
macro, but I don’t think MasterProxy has the issue described there. MasterProxy listens for requests with Plug.Cowboy and calls the configured Endpoint from there so requests do not go through more than one Endpoint for a single request.
1 Like
Many thanks. I’ve now got MasterProxy set up locally.
My umbrella’s /config/prod.exs
, proxying based on subdomains:
config :master_proxy,
http: [port: 3999],
backends: [
%{
host: ~r{^www\.},
phoenix_endpoint: MyappWeb.Endpoint
},
%{
host: ~r{^api\.},
phoenix_endpoint: MyappApi.Endpoint
},
%{
host: ~r{^members\.},
phoenix_endpoint: MyappMembersWeb.Endpoint
},
%{
host: ~r{^admin\.},
phoenix_endpoint: MyappAdminWeb.Endpoint
}
]
I haven’t tested with websockets yet.