本文记录如何配置Nginx使其支持TCP

添加TCP配置

vim /usr/local/nginx/conf/nginx.conf

在与http配置的同级目录下, 添加以下代码

tcp {
    server {
    listen 8988;
    proxy_pass 192.168.15.237:36000;
    }
}

启动nginx

/usr/local/nginx/sbin/nginx
# or
# /usr/local/nginx/sbin/nginx –s reload