一、安裝nginx使其支持stream
#直接使用yum(epel源)安裝,如果使用源碼安裝編譯時加上 --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段前加上
三、測試
可以安裝apache通過網頁訪問測試或者通過xshell連接訪問