You need both. The XMPP domain is needed for determining the user account JIDs and the BOSH Url is the XMPP to HTTP proxy that comes with Prosody or Ejabbered (this is needed because in browser clients are not allowed to directly talk to the 5222 port XMPP uses normally).
For Prosody see: https://prosody.im/doc/setting_up_bosh
I believe with Ejabberd Bosh is enabled by default.
Or you could use Snikket, which is a new initiative by the Prosody authors to provide an easy to install and preconfigured version of Prosody: https://snikket.org/
For STUN/TURN, you can either use the one build into ejabberd (use version 20.04 or later) or set up a Coturn server for Prosody.
Edit: For very nice integration of Nextcloud accounts with JSXC you can use
But setup of that is a bit more involved
