prosody / prosody-docker

Docker image building system for the Prosody XMPP server
https://hub.docker.com/r/prosody/prosody/
146 stars 49 forks source link

Web app BOSH 404 #32

Closed purplefish32 closed 8 years ago

purplefish32 commented 8 years ago

Sorry this is more a question than an issue and I am not sure if this is just a general prosody problem or something directly linked to my Docker setup.

I am trying use this image with my dockerized web application (apache2) via docker compose.

When I enable the BOSH plugin and connect to the prosody image I can sucessfully curl (after installing curl) http://localhost:5280/http-bind.

Bun when I try to do the same from my docker-compose linked web app container I keep getting 404s ex (from web container) : curl http://prosody:5280/http-bind

This is my first time using prosody so I may have miss understood something.

Do I need some kind of header or DNS configuration ?

mwild1 commented 8 years ago

The 404 is probably due to Prosody not recognising the host in the HTTP URL that you are using (this gets sent in the HTTP Host header). Prosody needs to match up the HTTP host to a host configured in its configuration file. Check out the docs at https://prosody.im/doc/http#virtual_hosts

Hope this helps!

purplefish32 commented 8 years ago

Thanks for the tip. you wouldent know where to set the Host header on the web app side ? Should apache2 be sending it ?

I allready have this in my apache config :

ServerName web
Header set Host "web"

And this in my prosody.cfg.lua

VirtualHost "web"

"web" is the docker-compose service name

purplefish32 commented 8 years ago

OK I foud it, I had the problem backwards,

prosody.cfg.lua Needs to know its own machine name not the host that is sending the request.

VirtualHost "prosody" http_host = "prosody"

Thanks for your time