nginx -t 出现unknown directive “stream“ 怎么解决? 求解

yum 安装nginx

vi /etc/nginx/nginx.conf

stream {
    upstream kube-apiserver {
        server 10.4.7.21:6443     max_fails=3 fail_timeout=30s;
        server 10.4.7.22:6443     max_fails=3 fail_timeout=30s;
    }
    server {
        listen 7443;
        proxy_connect_timeout 2s;
        proxy_timeout 900s;
        proxy_pass kube-apiserver;
    }
}

[root@hdss7-12 ~]# nginx -t 
nginx: [emerg] unknown directive "stream" in /etc/nginx/nginx.conf:91
nginx: configuration file /etc/nginx/nginx.conf test failed

[root@hdss7-12 ~]# tail -f /var/log/nginx/error.log 
2021/08/09 16:04:19 [emerg] 10858#10858: unknown directive "stream" in /etc/nginx/nginx.conf:91
2021/08/09 16:14:13 [emerg] 10868#10868: unknown directive "stream" in /etc/nginx/nginx.conf:91

你可能感兴趣的:(nginx -t 出现unknown directive “stream“ 怎么解决? 求解)