linux下使用nginx做tcp代理服务器
1、下载地址https://github.com/nginx/nginx2、解压tar -xvf 或unzip 3、编译安装 ./configure --with-stream;make;make install;4、配置参数cd /usr/local/nginx/conf修改nginx.confstream {upstream cloudsocke
·
1、下载地址
https://github.com/nginx/nginx
2、解压
tar -xvf 或unzip
3、编译安装
./configure --with-stream;make;make install;
4、配置参数
cd /usr/local/nginx/conf
修改nginx.conf
stream{
upstream cloudsocket
{
hash $remote_addr consistent;server 127.0.0.1:2016 weight=5 max_fails=3 fail_timeout=30s;server 127.0.0.1:2015 weight=5 max_fails=3 fail_timeout=30s;
}
server
{
listen 2014;proxy_connect_timeout 1s;proxy_timeout 3s;proxy_pass cloudsocket;
}}
5、启动服务
cd /usr/local/nginx/sbin
./nginx更多推荐
已为社区贡献2条内容
所有评论(0)