• 导航

阿里云ECS 中配置 Nginx stream 模块

记事本 2024-04-17 26 次浏览
阿里云ECS 默认是没有安装 nginx ,先安装 nginx
      
  yum update
yum install nginx
systemctl enable nginx
systemctl start nginx
其次,安装 stream 模块
      
  yum install nginx-mod-stream
    
之后,在 **events ** 上面,添加 stream
      
  stream{
server{
listen 443;
proxy_pass forward;
proxy_timeout 10m;
proxy_connect_timeout 5000ms;
}
upstream forward {
server ip:443;
}
}
最后,重启 nginx 即可
      
  /bin/systemctl restart nginx.service