The device uses port 1883 to forward to the backend server through nginx's TCP/UDP proxy.
The backend server checks the device's socket IP and it is the IP of the proxy server, not the actual IP of the device.
How to implement transparent proxy ,Let the nginx agent connect the actual IP of the device to the backend server?
Remark:
The device cannot get its own IP when connecting, so don’t think about it
is a TCP/UDP proxy, not http
Nginx Stream Module
The ngx_stream_core_module module is available since version 1.9.0. This module is not built by default, it should be enabled with the --with-stream configuration parameter.
This module is not included in the default build. You need to add
--with-stream
configuration when installing nginx.Example program