我想使用Nginx 1.9作为TCP负载均衡器.我在https://www.nginx.com/resources/admin-guide/tcp-load-balancing/中遵循了教程,但它没有用.
Nginx: [emerg] unknown directive "stream" in /opt/Nginx/Nginx.conf
events {
worker_connections 1024;
}
http {
# blah blah blah
}
stream {
upstream backend {
server 127.0.0.1:9630;
server 127.0.0.1:9631;
}
server {
listen 2802;
proxy_connect_timeout 1s;
proxy_timeout 3s;
proxy_pass backend;
}
}
你能告诉我如何配置它吗?