I'm getting clueless on this topic. I have a working websocket connection using Mosquitto on server_1 . The webapp that needs to publish the websocket data is in server_2 and is accessed behind a Nginx reverse proxy.
Now, in LAN everything works with unencrypted connection, but I need to encrypt it to publish it in internet, so I need to use the wss protocol.
I search for Nginx + Websocket tutorials and everyone mentions a http backend for the websocket (https://www.nginx.com/blog/websocket-nginx/). How can I set the http backend? I have only the "wss://..." Mosquitto address.
Because a websocket connection is bootstrapped via HTTP you setup NGINX proxying just as you would for any other HTTP server and just make sure you are including the headers to allow the protocol upgrade.
Assuming you are doing the SSL termination in NGINX something like this: