I just got it working ! Thanks so much @juan11perez for all the hard work done on this and generally for answering and being a kind human being, here’s my config for others’ reference :
In mosquitto.conf (Mosquitto MQTT broker configuration)
port 1883
protocol mqtt
...
listener 1884
protocol websockets
Additionally, you should map the container port 1884 to external port 1884
In NGINX default conf
server {
server_name mqtt.obenita.duckdns.org;
listen 443 ssl;
location / {
proxy_pass http://10.0.0.9:1884/; # The server you want to redirect to
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
The configuration in OwnTracks would be then :
- Host name - mqtt.yourdomain.duckdns.org
- TLS enabled
- Websockets enabled, port is 443 (NGINX port)
- Authentication - depends on what was previously configured
Thanks @rbray89 for the guidance in one of your replies to this post