centos上nginx转发tcp请求

下载最新版nginx

> wget http://nginx.org/download/nginx-1.17.1.tar.gz

解压缩

> tar zxvf nginx-1.17.1.tar.gz

> cd nginx-1.17.1

配置

> ./configure --with-stream --with-stream_ssl_module

构建

> make

> make install

修改配置文件

> vi /usr/local/nginx/conf/nginx.conf

stream {
  server {
    listen 5433;
    proxy_pass 172.16.105.41:5433;
  }
}

启动nginx

nohup /usr/local/nginx/sbin/nginx &

猜你喜欢

转载自www.cnblogs.com/lavezhang/p/11096813.html
今日推荐