一、安装nginx使其支持stream
#直接使用yum安装,如果使用源码安装编译时加上 --with-stream
[root@localhost ~]# yum -y install nginx
二、配置nginx配置文件
[root@localhost ~]# vim /etc/nginx/nginx.conf
stream {
server {
listen 8000; #将8000端口,转到113的80
proxy_connect_timeout 10s;
proxy_timeout 5s;
proxy_pass 192.168.200.113:80;
}
}
在http段前加上
三、关闭防火墙,启动服务测试,113中安装了Apache,测试页面内容为111