[erlang-questions] Deploying multiple webapps

Chandru chandrashekhar.mullaparthi@REDACTED
Wed Dec 16 00:57:56 CET 2015


Hi Hugo,

Why does all this have to be done in Erlang?

It sounds like your best bet is to use something like nginx/varnish/haproxy
(or even Apache as you explained) to front your server farm. You can get
that component to then rewrite the URLs and route requests to wherever your
Erlang web services are located. I would do that rather than trying to do
everything in Erlang.

cheers,
Chandru


On 15 December 2015 at 23:41, Hugo Mills <hugo@REDACTED> wrote:

>    I've got a collection of small services, with minimal coupling
> between the back ends of those services (orchestration is done mostly
> client-side). I'd like to put an HTTPS interface in front of each one
> -- say, with cowboy.
>
>    What I'd also like to be able to do, at least in principle, is
> deploy some arbitrary subset of those services on each machine in my
> (comedically-named) server farm. I'd like to be able to do this with
> one TLS configuration, and preferably under a single port.
>
> i.e., access my services through
>
> https://server.me/service1/...
> https://server.me/service2/...
> https://server.me/service3/...
>
>    Now, in python-land, which is largely where I come from, I'd set up
> Apache with mod-wsgi, and deploy each WSGI app to a specific URL
> within the same URL namespace. I'm not quite sure how to do that
> easily with erlang+cowboy, because there seems to be no easy way of
> treating a webapp as a unit within a larger server configuration. I
> keep coming to one of two approaches:
>
> 1) Write each service completely independently (as HTTP), run it on a
>    distinct port, and splice together the URL namespaces through a
>    reverse proxy on a "normal" web server like Apache.
>
> 2) Find some way to automatically write a top-level router for cowboy,
>    for each set of services that I want to deploy to a machine.
>
>    I don't much like option 1, but I like option 2 even less. I guess
> I could write some kind of "top-level" app that, given a bunch of
> webapp modules (via a configuration file of some kind), gets a router
> for each module and transforms those routers into a single router
> config. Does such a thing already exist?
>
>    It all just feels a bit awkward, and I feel like I'm missing
> something. What do other people do to put together this kind of setup?
>
>    Hugo.
>
> --
> Hugo Mills             | I spent most of my money on drink, women and fast
> hugo@REDACTED carfax.org.uk | cars. The rest I wasted.
> http://carfax.org.uk/  |
> PGP: E2AB1DE4          |                                            James
> Hunt
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20151215/683223b2/attachment.htm>


More information about the erlang-questions mailing list