[ejabberd] virtual host config

Magnus Henoch mange at freemail.hu
Mon Mar 12 22:34:04 MSK 2007

"Safford, Brian" <brian.safford at eds.com> writes:

> Does the {listen section of a virtual host config go inside the
> {host_config for each virtual host?
> If not, how do you set up the {listen section for each virtual host?

The {listen configuration is for each Erlang node, not for each
virtual host.  There is no way to tell what virtual host an incoming
connection belongs to before you have accepted it.

You could configure c2s to listen on several ports, and use ACLs to
accept only certain virtual hosts on certain ports, e.g. (untested):

{acl, host1, {server, "example.com"}}.
{acl, host2, {server, "example.org"}}.
{access, host1, [{allow, host1}, {deny, all}]}.
{access, host2, [{allow, host2}, {deny, all}]}.

 [{5222, ejabberd_c2s, [{access, host1}]},
  {5223, ejabberd_c2s, [{access, host2}]}]}.

JID: legoscia at jabber.cd.chalmers.se

More information about the ejabberd mailing list