鍍金池/ 問答/Linux  HTML/ 求教nginx 配置health_check

求教nginx 配置health_check

nginx/1.13.12

# kube.conf
upstream kubeapi {
        least_conn;
        zone kube_api_zone 64k;
        server 192.168.8.228:6443 max_fails=1 fail_timeout=30s;
        server 10.10.10.227:6443 max_fails=1 fail_timeout=30s;
        server 192.168.8.229:6443 max_fails=1 fail_timeout=30s;
}
server {
        listen        127.0.0.1:6443;
        proxy_pass    kubeapi;
        proxy_timeout 10m;
        proxy_connect_timeout 1s;
        health_check;
}

提示health_check unknown directive "health_check" in /etc/nginx/conf/sites_stream/kube.conf:13

參考這個Module ngx_stream_upstream_hc_module

#docker-compose.yaml
version: '2.1'
services:
  tcp-proxy:
    image: spanda/proxy:tcp
    container_name: tcp-proxy
    volumes:
      - /tmp/nginx/sites_stream:/etc/nginx/conf/sites_stream
      - /tmp/nginx/sites_http:/etc/nginx/conf/sites_http
      - /tmp/nginx/ssl:/etc/nginx/conf/ssl
    logging:
      driver: "json-file"
      options:
        max-size: "50m"
        max-file: "3"
    network_mode: "host"

只有商業(yè)版本支持嗎?

回答
編輯回答
情殺

這個模塊并不需要商業(yè)版本,但也不包含在標準的發(fā)行包里,需要單獨編譯,才能安裝。
參考下面的官方文檔。

https://www.nginx.com/resourc...

2017年6月20日 02:53