openfire + nginx?

1,104 views
Skip to first unread message

Colin Freas

unread,
Aug 13, 2013, 7:53:10 PM8/13/13
to str...@googlegroups.com

Has anyone gotten this to work recently?

I'm using installs of nginx and OpenFire locally that I know to be working (because they're used with other applications & a little Java echobot works) but I get no joy from the Strophe's echobot.

ngingx conf looks like:
        location /http-bind {
            proxy_buffering off;
            tcp_nodelay on;
            keepalive_timeout 55;
            proxy_pass http://localhost:7070;
        }

echobot.js BOSH_SERVICE is:
        var BOSH_SERVICE = 'http://localhost:8181/http-bind/'



Any help appreciated.

-Colin

Daryl Herzmann

unread,
Aug 14, 2013, 8:57:05 AM8/14/13
to str...@googlegroups.com
Is echobot.js being served up from the :8181 port as you have the bosh service on?  What happens if you put that http-bind URI into your web browser, do you get a response.  Also, I think your proxy needs to point at /http-bind, like what is done for apache.

 ProxyPass /http-bind http://openfire:7070/http-bind

daryl

Colin Freas

unread,
Aug 14, 2013, 2:53:04 PM8/14/13
to str...@googlegroups.com
Hey Daryl.

Thanks for the note.  Everything is being served on 8181.

Also tried every permutation of this I could think of:  

... and similarly with the BOSH_SERVICE var (using 8181).  Nothing seems to work with nginx.

With one of the configs (not sure which, it's all a muddle) http://localhost:8181/http-bind/?<body rid="1"/> returns what looks like a valid response back from OpenFire, which is the same response received from http://localhost:7070/http-bind/?<body rid="1"/>.  But even then, neither basic.html nor echobot.html work.

I wound up setting it up with Apache, and all's well.  Was trying nginx because I thought it'd be easier from scratch, but it's already as much of a pain as Apache (which I know pretty well).

Could be issue with reverse proxy?  Apparently nginx lacks anything like ProxyPassReverse.  I don't know if OpenFire is using any of the headers affected by ProxyPassReverse, as I haven't tested if the Apache setup works without that, but that could be the issue.

If anyone figures it out, maybe throw a note up here.




--
You received this message because you are subscribed to the Google Groups "Strophe" group.
To unsubscribe from this group and stop receiving emails from it, send an email to strophe+u...@googlegroups.com.
To post to this group, send email to str...@googlegroups.com.
Visit this group at http://groups.google.com/group/strophe.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Daryl Herzmann

unread,
Aug 14, 2013, 4:17:50 PM8/14/13
to str...@googlegroups.com
Colin,

What about the test with just putting the URI into your web browser or running wget against it, what happens?  Does openfire log anything when you made this request?  I don't think reverse proxying is necessary.

daryl

Colin Freas

unread,
Aug 14, 2013, 5:28:23 PM8/14/13
to str...@googlegroups.com

Turned off reverse proxy with Apache: basic & echobot still work, so seems like you're right there.

Not sure exactly which URI you're asking about.  http://hostname:8181/http-bind/ gives me a 400 Bad Request from Jetty.  Going to http://hostname:8181/http-bind/?<body%20rid="1"/> gives me what looks like a valid _BOSH_ object.  That's the case with Apache & nginx.  

Same behavior going to http://hostname:7070/http-bind/ & http://hostname:7070/http-bind/?<body%20rid="1"/>.  (7070 is configured as OpenFire binding port.)

Tried exact same settings in nginx & Apache, in terms of trailing slahes doesn't work.  Here's what I've got: 
... in basic.js: var BOSH_SERVICE = 'http://hostname:8181/http-bind/';

... in nginx.conf:
        location /http-bind/ {
            proxy_buffering off;
            tcp_nodelay on;
            keepalive_timeout 55;
            proxy_pass http://hostname:7070/http-bind/;
        }

& that doesn't result in a connection to OpenFire.  

In terms of /'s that's exactly what I have in Apache.  In Apache, basic.html connects & echobot echos messages.  In nginx, basic.html gets a challenge from OpenFire then sends a response then something hangs.  Eventually there's a 404 "Invalid SID" in the console.  I don't think the invalid SID is a tree worth barking up, but there it is.

This shows in nginx log:
2013/08/14 17:10:03 [error] 8136#6460: *1 upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while connecting to upstream, client: xxx.xxx.x.xxx, server: hostname, request: "POST /http-bind/ HTTP/1.1", upstream: "http://[fe80::c081:623f:54d:1095]:7070/http-bind/", host: "w-1682:8181", referrer: "http://hostname:8181/strophejs-1.0.2/examples/basic.html"

No idea from that.  Maybe I can hit up the nginx guys, though, it's working at this point, so I don't really care that much.  :)

OpenFire error log has nothing relevant (nearest log entry is hours prior) nor does info.log.



Reply all
Reply to author
Forward
0 new messages