[ejabberd] how to reverse proxy mod_http_upload with nginx?

pitchum pitchum at gramaton.org
Fri Oct 27 15:48:34 MSK 2017


Le 27/10/2017 à 14:38, Holger Weiß a écrit :
> * pitchum <pitchum at gramaton.org> [2017-10-27 14:32]:
>> I was expecting an option like 'external_url' for prosody [2] and then
>> configuring mod_http_upload like the following:
>>
>>   mod_http_upload:
>>     put_url: "http://jabber.example.net:5280/upload"
>>     get_url: "https://jabber.example.net/data"
>>     external_url: "https://jabber.example.net/upload"
>>
>> 'put_url' would be served by ejabberd while 'external_url' would be
>> served by nginx and sent to the client as the upload slot to use.
> 
> 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.

Here is the log (I don't know how to interpret it though):

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>}}
[{gen_mod,start_module,4,[{file,"src/gen_mod.erl"},{line,203}]},
 {lists,foreach,2,[{file,"lists.erl"},{line,1338}]},
 {gen_mod,start_link,0,[{file,"src/gen_mod.erl"},{line,79}]},
 {supervisor,do_start_child,2,[{file,"supervisor.erl"},{line,365}]},
 {supervisor,start_children,3,[{file,"supervisor.erl"},{line,348}]},
 {supervisor,init_children,2,[{file,"supervisor.erl"},{line,314}]},
 {gen_server,init_it,2,[{file,"gen_server.erl"},{line,365}]},
 {gen_server,init_it,6,[{file,"gen_server.erl"},{line,333}]}]
2017-10-27 14:41:46.326 [critical]
<0.247.0>@gen_mod:maybe_halt_ejabberd:294 ejabberd initialization was
aborted because a module start failed.


-- 
pitchum


More information about the ejabberd mailing list