MQTT, HTTP Haproxy Configuration

If you are building a system that serves both HTTP and MQTT, I sure that you have to use HAProxy. So in this post, I will share you the way to setup HAProxy to serve Nginx and MQTT Broker.

Your haproxy.cfg file should contain the source code below:

Haproxy MQTT Configuration

Note: broker is MQTT Broker’s hostname

Haproxy Nginx

For monitoring Haproxy, You can add Haproxy Stats Configuration

Final Result haproxy.cfg