0
点赞
收藏
分享

微信扫一扫

nginx TCP负载均衡ip哈希写法

书坊尚 2023-04-02 阅读 100

stream {
    upstream netty {
        hash $remote_addr;
        server s1:30020;
        server s2:30020;
    }
    server {
        listen 30001;
        proxy_pass netty;
    }
}

ip_hash这种配置方法在这里报错,需要改成上边那种写法。
hash $remote_addr;即为根据ip进行hash。





举报

相关推荐

0 条评论