[ejabberd] how to reverse proxy mod_http_upload with nginx?

Holger Weiß holger at zedat.fu-berlin.de
Fri Oct 27 15:57:25 MSK 2017


* pitchum <pitchum at gramaton.org> [2017-10-27 14:48]:
> Le 27/10/2017 à 14:38, Holger Weiß a écrit:
> > The 'put_url' is what you think of as the 'external_url': It's sent to
> > the client as the upload slot to use and can be served by Nginx.  I.e.,
> > you can just specify something like this:
> > 
> >   put_url: "https://jabber.example.net/upload"
> 
> Doing this prevents ejabberd from starting. I guess this is because
> ejabberd tries to spawn its own HTTP server to listen on port 443 which
> is already used by nginx.

No.  ejabberd spawns only those listening sockets that you configured in
the 'listen:' block.

> 2017-10-27 14:41:46.324 [critical] <0.247.0>@gen_mod:start_module:212
> Problem starting the module mod_http_upload for host jabber.example.net
>  options: [{put_url,<<"https://jabber.example.net/upload">>},
>            {get_url,<<"https://jabber.example.net/data">>},
>            {docroot,<<"/srv/ejabberd/upload">>},
>            {thumbnail,false}]
>  error: {error,{already_started,<0.483.0>}}

My guess is that you're using the same put_url for multiple virtual
hosts.  This is currently not supported:

| Note: Different virtual hosts cannot use the same PUT URL.

[ https://docs.ejabberd.im/admin/configuration/#mod-http-upload ]

As a workaround, you could either use @HOST@ within the put_url, or make
sure mod_http_upload is only configured for a single domain and then
announce upload.example.net using the extra_domains option of mod_disco.

Is there a reason you're still using a get_url that's different from the
put_url, by the way?

Holger


More information about the ejabberd mailing list