I just encountered this posting about using nginx to do load balancing of MQTT connections and my first thought was “I didn’t know you could do that” followed by “Lots of OH users have MQTT and nginx.” So I ended up going down a rabbit hole and research.
First, let me state I’ve not actually done this myself. I’ve just switched over to using a pfsense firewall and managed to break all the things (actually the things were already broken because DD-WRT wasn’t doing static DHCP leases right and I hacked some settings on a couple of my RPis which worked until I changed my internal subnet). I’m posting this info here in case someone wants to run with this before I’ll get a chance to.
Here are a set of links that appear to be useful in setting this up. @binderth, you might find something useful for your cottage project.
- NGINX Plus for the IoT: Encrypting and Authenticating MQTT Traffic NOTE: This and the link above are based on nginx plus which is not free
- MQTT Bridge with Mosquitto and nginx @binderth, this link in particular looks interesting
- MQTT through nginx and owntracks OwnTracks Forum posting
Please post if you give it a try.