环境搭建
略
配置
使用nginx做网关,emq获取设备真实ip地址
- 修改emq配置文件
emqx.conf
## Enable the Proxy Protocol V1/2 if the EMQ X cluster is deployed
## behind HAProxy or Nginx.
##
## See: https://www.haproxy.com/blog/haproxy/proxy-protocol/
##
## Value: on | off
listener.tcp.external.proxy_protocol = on
- 修改nginx配置
server {
listen 9999;
# 开启 proxy_protocol 协议
proxy_protocol on;
}