美文网首页
nginx 配置 tcp 转发

nginx 配置 tcp 转发

作者: 风亡小窝 | 来源:发表于2020-07-24 11:09 被阅读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/

相关文章

网友评论

      本文标题:nginx 配置 tcp 转发

      本文链接:https://www.haomeiwen.com/subject/bwhjlktx.html