# Proxy to ejabberd

**URL:** <https://www.ruby-forum.com/t/proxy-to-ejabberd/164327>\
**Category:** NGINX\
**Created:** [March 31, 2009, 8:47am UTC](https://www.ruby-forum.com/t/proxy-to-ejabberd/164327 "2009-03-31T08:47:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![whoahbot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/9fc348/32.png) [@whoahbot](https://www.ruby-forum.com/u/whoahbot)\
**Post date:** [March 31, 2009, 8:47am UTC](https://www.ruby-forum.com/t/proxy-to-ejabberd/164327/1 "2009-03-31T08:47:41Z")

</div>

Hello!

I’m having difficulty getting nginx 0.6.32 to proxy to an ejabberd  
server using a BOSH connection.

Each time I connect, I get this error in the logs:

2009/03/31 06:28:48 27059#0: \*1 upstream prematurely closed connection  
while reading response header from upstream, client: 67.189.35.116,  
server: [ship.whoahbot.com](http://ship.whoahbot.com), request: “POST /http-bind/ HTTP/1.1”,  
upstream: “[http://127.0.0.1:5280/http-bind/](http://127.0.0.1:5280/http-bind/)”, host: “[ship.whoahbot.com](http://ship.whoahbot.com)”,  
referrer: “[http://ship.whoahbot.com/](http://ship.whoahbot.com/)”

Here is my nginx.conf:  
Gist - nginx.conf

Am I missing a configuration directive needed to make this work?

Thanks for any help you can give.

Posted at Nginx Forum: [Proxy to ejabberd](http://forum.nginx.org/read.php?2,657,657#msg-657)

---

<div class="post-metadata">

**Author:** ![whoahbot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/9fc348/32.png) [@whoahbot](https://www.ruby-forum.com/u/whoahbot)\
**Post date:** [March 31, 2009, 4:14pm UTC](https://www.ruby-forum.com/t/proxy-to-ejabberd/164327/2 "2009-03-31T16:14:34Z")

</div>

## whoahbot Wrote:

> prematurely closed connection while reading  
> Am I missing a configuration directive needed to  
> make this work?
> 
> Thanks for any help you can give.

OK, we’ve run into a small glitch here and I apologize for the second  
message. The use of “bbcode” caused a bit of a problem in the email. The  
nginx.conf is at [nginx.conf · GitHub](https://gist.github.com/acbf41d3d638317d1fc4).

Posted at Nginx Forum: [Re: Proxy to ejabberd](http://forum.nginx.org/read.php?2,657,666#msg-666)

---

<div class="post-metadata">

**Author:** ![whoahbot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/9fc348/32.png) [@whoahbot](https://www.ruby-forum.com/u/whoahbot)\
**Post date:** [March 31, 2009, 6:03pm UTC](https://www.ruby-forum.com/t/proxy-to-ejabberd/164327/3 "2009-03-31T18:03:45Z")

</div>

On Mon, Mar 30, 2009 at 11:35 PM, whoahbot [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hello!
> 
> I’m having difficulty getting nginx 0.6.32 to proxy to an ejabberd server using a BOSH connection.

Are you sure BOSH is supported?  
[http://www.ruby-forum.com/topic/162053](http://www.ruby-forum.com/topic/162053)

It was requested a while ago and I don’t know the differences and such  
but I am not sure nginx even supports it (?)

---

<div class="post-metadata">

**Author:** ![whoahbot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/9fc348/32.png) [@whoahbot](https://www.ruby-forum.com/u/whoahbot)\
**Post date:** [March 31, 2009, 6:26pm UTC](https://www.ruby-forum.com/t/proxy-to-ejabberd/164327/4 "2009-03-31T18:26:02Z")

</div>

Hi all,

Got this figured out, was an ejabberd problem after all.

Thanks!

Posted at Nginx Forum: [Re: Proxy to ejabberd](http://forum.nginx.org/read.php?2,657,673#msg-673)

---

<div class="post-metadata">

**Author:** ![whoahbot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/9fc348/32.png) [@whoahbot](https://www.ruby-forum.com/u/whoahbot)\
**Post date:** [December 29, 2010, 9:54pm UTC](https://www.ruby-forum.com/t/proxy-to-ejabberd/164327/5 "2010-12-29T21:54:00Z")

</div>

I was also getting 502 Bad Gateway.

The problem was that I was missing loading the http-bind module in  
ejabberd:

{modules,  
[  
…  
{mod\_http\_bind, []},

Posted at Nginx Forum:

> **[Re: Proxy to ejabberd](https://forum.nginx.org/read.php?2,657,162067#msg-162067)**
>
> Hello! I'm having difficulty getting nginx 0.6.32 to proxy to an ejabberd server using a BOSH connection. Each time I connect, I get this error in the logs: 2009/03/31 06:28:48 \[error\] 27059#0: \*1 upstream prematurely closed connection while reading...

---

<div class="post-metadata">

**Author:** ![whoahbot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/9fc348/32.png) [@whoahbot](https://www.ruby-forum.com/u/whoahbot)\
**Post date:** [May 14, 2010, 11:17pm UTC](https://www.ruby-forum.com/t/proxy-to-ejabberd/164327/6 "2010-05-14T23:17:20Z")

</div>

## whoahbot Wrote:

> Hi all,
> 
> Got this figured out, was an ejabberd problem  
> after all.
> 
> Thanks!

Hi! So what was the solution? I am having the same problem.

Posted at Nginx Forum:

> **[Re: Proxy to ejabberd](https://forum.nginx.org/read.php?2,657,86797#msg-86797)**
>
> Hello! I'm having difficulty getting nginx 0.6.32 to proxy to an ejabberd server using a BOSH connection. Each time I connect, I get this error in the logs: 2009/03/31 06:28:48 \[error\] 27059#0: \*1 upstream prematurely closed connection while reading...
