./configure --prefix=/usr/local/nginx-1.24.0 --user=nginx --group=nginx --conf-path=/usr/local/nginx-1.24.0/etc/nginx.conf --http-client-body-temp-path=/usr/local/nginx-1.24.0/cache/client_temp --http-proxy-temp-path=/usr/local/nginx-1.24.0/cache/proxy_temp --http-fastcgi-temp-path=/usr/local/nginx-1.24.0/cache/fastcgi_temp --http-uwsgi-temp-path=/usr/local/nginx-1.24.0/cache/uwsgi_temp --http-scgi-temp-path=/usr/local/nginx-1.24.0/cache/scgi_temp --with-compat --with-debug --with-http_geoip_module --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-http_degradation_module --with-http_slice_module --with-http_auth_request_module --with-pcre --with-pcre-jit --with-mail --with-mail_ssl_module --with-threads --with-cc-opt='-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module

如果是yum安装

yum install nginx-mod-stream -y
stream {
    upstream tcp_game_8999 {
        hash $remote_addr;
        server 192.168.11.88:8999 max_fails=5 fail_timeout=300s;
    }
    server {
        listen 8090;
        listen [::]:8090;
        #server_name  a.com;
        proxy_pass tcp_game_8999;
    }
}