stream {
    upstream samba1 {
        server 10.8.10.70:139;
    }
    upstream samba2 {
        server 10.8.10.70:445;
    }
    server {
        listen 192.168.0.145:139;
        proxy_pass samba1;
    }
    server {
        listen 192.168.0.145:445;
        proxy_pass samba2;
    }

    upstream socks5 {
        server 192.168.25.1:1080;
    }
    server {
        listen 192.168.0.145:1080;
        proxy_pass socks5;
    }
}
