# For more information on configuration, see # * Official English Documentation: http://nginx.org/en/docs/ # * Official Russian Documentation: http://nginx.org/ru/docs/ # 支持stream load_module /usr/lib64/nginx/modules/ngx_stream_module.so user nginx; worker_processes auto; error_log /var/log/nginx/error.log; pid /run/nginx.pid; # Load dynamic modules. See /usr/share/doc/nginx/README.dynamic. include /usr/share/nginx/modules/*.conf; worker_rlimit_nofile 65535; events { use epoll; worker_connections 51200; multi_accept on; }
# stream透传 stream { upstream ldap { server 22.104.1.1:389; server 22.104.1.2:389; server 22.104.1.8:389; } server { listen 8389; proxy_pass ldap; } }
# http代理
http {
# nacos server 负载
upstream nacos {
# 配置三台Nacos Server的IP和端口
server 192.168 35.32:8848;
server 192.168 35.34:8848;
server 192.168 35.42:8848;
}
server {
listen 8848; # 可以换成其他端口
server name 192.168.35.31; # 如果有域名可换成域名
location / {
proxy pass http://nacos;
}
}
标签:http,stream,配置,192.168,server,8848,nginx From: https://www.cnblogs.com/tgttttttttt/p/17044389.html