Nginx代理MQTT Broker
参考: https://blog.csdn.net/yinjl123/article/details/132610040
1.nginx安装编译时,需要增加--with-stream
模块
wget https://nginx.org/download/nginx-1.22.1.tar.gz
tar -zxvf nginx-1.22.1.tar.gz
cd nginx-1.22.1
./configure --with-stream
make
make install
- 修改nginx配置文件
cd /usr/local/nginx/conf
vim nginx.conf
在http同级,添加stream模块
stream {
upstream mqtt_server {
server 192.168.33.15:1883;
}
server {
listen 8086 so_keepalive=on;
proxy_pass mqtt_server;
}
}
http {
}
3.启动nginx
cd /usr/local/nginx/
cd sbin
./nginx
文章作者:Administrator
文章链接:http://localhost:8090//archives/nginx-dai-li-mqttbroker
版权声明:本博客所有文章除特别声明外,均采用CC BY-NC-SA 4.0 许可协议,转载请注明出处!
评论