On 5 July 2014 00:26, Hugo Osvaldo Barrera <h...@barrera.io> wrote:
> Hi,
> I'm trying to set bosh without success.

Thanks for the details. One key bit of info missing: what version of
Prosody are you using?

>     bosh_ports = { 5280 }

Probably best to drop this line. 5280 is the default, and bosh_ports
has been removed from 0.9+.

> When testing this locally:
> # curl -I localhost:5280/http-bind
> HTTP/1.1 404 Not Found
> Connection: Keep-Alive
> Content-Length: 369
> Date: Fri, 04 Jul 2014 23:06:25 GMT
> # curl localhost:5280/http-bind
> <html><body>
>         <p>It works! Now point your BOSH client to this URL to connect to 
> Prosody.</p>
>         <p>For more information see <a 
> href="http://prosody.im/doc/setting_up_bosh";>Prosody: Setting up BOSH</a>.</p>
>         </body></html>
> # curl xmpp.barrera.io/http-bind
> <!DOCTYPE html>
> <html>
> <head><meta 
> charset="utf-8"><style>body{margin-top:14%;text-align:center;background-color:#F8F8F8;font-family:sans-serif;}h1{font-size:xx-large;}p{font-size:x-large;}p+p
>  { font-size: large; font-family: courier }</style>
> </head>
> <body><h1>404 Not Found</h1><p>Whatever you were looking for is not here. 
> It's behind you.</p><p>Unknown host: xmpp.barrera.io</p>
> </body>
> My nginx config is LITERALLY a copy-paste from
> https://prosody.im/doc/setting_up_bosh
> Looking at pidgin's log, it gets the same 404 message I via curl
> xmpp.barrera.io/http-bind.
> I've also tried setting xmpp.barrera.io.

Sounds like you're using Prosody 0.9. Prosody 0.8 totally ignored the
HTTP host, which simplified setup but led to some unintuitive
behaviour and limitations. In Prosody 0.9 you need to make sure to
tell Prosody about what HTTP host you will be using (if it isn't the
same as an XMPP host in your config).

I'm going to guess that your XMPP host is "barrera.io", and Prosody is
running at "xmpp.barrera.io". This is a common setup, and the fix is
easy. Under your "barrera.io" host in Prosody's config, just tell it
what HTTP host to expect:

  VirtualHost "barrera.io"
     ...options here....
     http_host = "xmpp.barrera.io" -- HTTP requests will be addressed to here

> After looking at the error a bit, I tried some guessing and changed and 
> changed nginx to:
>     location / {
>         proxy_pass        http://localhost:5280/http-bind;
>         proxy_set_header  Host "localhost";
>         proxy_buffering off;
>         tcp_nodelay on;
>     }
> (notice the change in Host). Why did I need this? Has anyone else had similar 
> experiences?

This worked because you probably have "localhost" as a VirtualHost in
your config. This would also have worked (and be more correct):

   proxy_set_header  Host "barrera.io";

If you prefer you can do this *instead* of setting http_host in
Prosody's config. The only advantage to configuring it in Prosody is
that you can then easily serve multiple HTTP hosts (which may or may
not be useful to you).

> After this change, curl http://xmpp.barrera.io/ works as expected. Pidgin
> manages to connect but with absolutely no encryption. If I enable HTTPS,
> it fails. If I require encryption on the client or server side (or both),
> it fails too.

https://xmpp.barrera.io/ seems to work for me (in my browser), so I
don't know what the problem might be here. Check Pidgin's debug logs
perhaps (Help->Debug).


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

Reply via email to