events { worker_connections 1024; } error_log /var/log/nginx.log debug; http { server { listen 8080; root /usr/share/nginx/html; # Redirect requests for / to /status.html location = / { return 301 /status.html; } location = /status.html { } # Everything beginning with /status (except for /status.html) is # processed by the status handler location /status { status; } } } stream { upstream tcp_backend { zone tcp_backend 64k; server 172.17.0.1:3307; server 172.17.0.1:3308; } upstream hc_backend { zone hc_backend 64k; server 172.17.0.1:9201; server 172.17.0.1:9202; } match tcp { expect ~ "MySQL is running"; } server { listen 9200; status_zone hc_server; proxy_pass hc_backend; } server { listen 3306; status_zone tcp_server; health_check match=tcp port=9200; proxy_pass tcp_backend; } }