nginx 配置 tcp 转发

2020-07-24  本文已影响0人  风亡小窝

执行 nginx -t 查看配置文件位置

[root@iZwz9820ftxvkjzm4qyv9dZ ~]# nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful

vim /usr/local/nginx/conf/nginx.conf

添加

stream {
    upstream redis-cluster-proxy-backend {
        server localhost:7777;
        server localhost:7778;
    }

    server {
        listen 6000;
        proxy_pass redis-cluster-proxy-backend;
    }
}

https://docs.nginx.com/nginx/admin-guide/load-balancer/tcp-udp-load-balancer/

上一篇 下一篇

猜你喜欢

热点阅读