nginx配置如下:
1 # For more information on configuration, see 2 # * Official English Documentation: http://nginx.org/en/docs/ 3 # * Official Russian Documentation: http://nginx.org/ru/docs/ 4 user nginx; 5 worker_processes auto; 6 error_log /var/log/nginx/error.log; 7 pid /run/nginx.pid; 8 9 # Load dynamic modules. See /usr/share/doc/nginx/README.dynamic. 10 include /usr/share/nginx/modules/*.conf; 11 worker_rlimit_nofile 65535; 12 events { 13 use epoll; 14 worker_connections 51200; 15 multi_accept on; 16 } 17 18 stream { 19 upstream ldap { 20 server 22.104.1.1:389; 21 server 22.104.1.2:389; 22 server 22.104.1.8:389; 23 } 24 server { 25 listen 8389; 26 proxy_pass ldap; 27 } 28 }
如果,nginx版本不支持stream,可修改nginx配置,在第一行添加如下内容:
load_module /usr/lib64/nginx/modules/ngx_stream_module.so