nginx
#在实际的生成环境中,为了保护内网服务器设备,在前置部署了一台nginx,从而进行数据的转发
#配置nginx配置,新建tcp转发的配置文件
#如我的本机的nginx目录为
cd /usr/local/webserver/nginx/conf
#进入nginx的conf目录,新建配置文件
touch tcp.conf
cat > tcp.conf << EOF
stream{
upstream sebase{
server 192.168.31.151:443;
server 192.168.31.151:10888;
server 192.168.31.151:10555;
server 192.168.31.151:10666;
server 192.168.31.151:10777;
server 192.168.31.151:10999;
}
#tcp
server{
listen 443;
proxy_connect_timeout 20s;
proxy_timeout 5m;
proxy_pass sebase;
}
server{
listen 10888;
proxy_connect_timeout 20s;
proxy_timeout 5m;
proxy_pass sebase;
}
server{
listen 10555;
proxy_connect_timeout 20s;
proxy_timeout 5m;
proxy_pass sebase;
}
server{
listen 10666;
proxy_connect_timeout 20s;
proxy_timeout 5m;
proxy_pass sebase;
}
server{
listen 10777;
proxy_connect_timeout 20s;
proxy_timeout 5m;
proxy_pass sebase;
}
#udp
server{
listen 10999 udp;
proxy_connect_timeout 20s;
proxy_timeout 5m;
proxy_pass sebase;
}
}
EOF
nginx
#在实际的生成环境中,为了保护内网服务器设备,在前置部署了一台nginx,从而进行数据的转发
#配置nginx配置,新建tcp转发的配置文件
#如我的本机的nginx目录为
cd /usr/local/webserver/nginx/conf
#进入nginx的conf目录,新建配置文件
touch tcp.conf
cat > tcp.conf << EOF
stream{
upstream sebase{
server 192.168.31.151:443;
server 192.168.31.151:10888;
server 192.168.31.151:10555;
server 192.168.31.151:10666;
server 192.168.31.151:10777;
server 192.168.31.151:10999;
}
#tcp
server{
listen 443;
proxy_connect_timeout 20s;
proxy_timeout 5m;
proxy_pass sebase;
}
server{
listen 10888;
proxy_connect_timeout 20s;
proxy_timeout 5m;
proxy_pass sebase;
}
server{
listen 10555;
proxy_connect_timeout 20s;
proxy_timeout 5m;
proxy_pass sebase;
}
server{
listen 10666;
proxy_connect_timeout 20s;
proxy_timeout 5m;
proxy_pass sebase;
}
server{
listen 10777;
proxy_connect_timeout 20s;
proxy_timeout 5m;
proxy_pass sebase;
}
#udp
server{
listen 10999 udp;
proxy_connect_timeout 20s;
proxy_timeout 5m;
proxy_pass sebase;
}
}
EOF