Hi all,

As the title suggests, I’m trying to run an ejabberd (xmpp) server behind an nginx reverse proxy. The reason is, I want to be able to run the server on my raspberry pi at home, but have people connect to it through my VPS, which is running nginx. This would be nice because I don’t need a static ip and I don’t have to leak my ip address.

I have looked this up, but have not found an answer that works exactly for my use case.

My current nginx configuration looks like this:

stream {
	upstream xmppserver {
		server 10.8.0.3:5223;
	}

	upstream turnserver {
		server 10.8.0.3:3478;
	}

	map $ssl_preread_alpn_protocols $upstream {
		"xmpp-client" xmppserver;
		"stun.turn" turnserver;
		"stun.nat-discovery" turnserver;
	}

	server {
		listen 6969;
		proxy_pass $upstream;
		proxy_protocol on;
	}
}

And I have a DNS entry telling XMPP clients to contact my server at port 6969 (this was just for testing):

I would also need to figure out how to supply ejabberd with the correct certificates for the domain. Since it’s running on a different computer than the reverse proxy, would I have to somehow copy the certificate over every time it has to be renewed?

Thank you for your help.

thelastknowngod
link
fedilink
English
11Y

It auto discovers machines/instances/VMs/containers in the mesh and figures out the secure routing on the fly. If you couldn’t ensure a consistent IP from the home address it wouldn’t matter… The service mesh would work it out.

It is probably overkill for this project though… Something to think about…

Ádám
creator
link
fedilink
English
11Y

I already have a constant ip on the vpn I still don’t get it, sorry

Create a post

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don’t control.

Rules:

  1. Be civil: we’re here to support and learn from one another. Insults won’t be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it’s not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don’t duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

  • 1 user online
  • 279 users / day
  • 589 users / week
  • 1.34K users / month
  • 4.55K users / 6 months
  • 1 subscriber
  • 3.5K Posts
  • 70K Comments
  • Modlog