场景说明:192.168.30.X主机配置 4370、4371 两端口监听,proxy pass 指定应用服务器程序
组成部分说明:
1)域名映射:192.168.30.X big.myserver.com 192.168.30.X big.myserver2.com
2)应用服务器程序(测试):tomcat,端口8080
3)nginx-1.2.9 Window版本
具体过程:
1)安装 nginx-1.2.9 Window版本(具体安装百度) 下载地址
2)检查nginx安装是否正常 & 启动(打开CMD,cd %nginx-1.2.9% 根目录)
检查参数是否正常,执行: nginx -t -c ./conf/nginx.conf
查看nginx执行: tasklist /fi "imagename eq nginx.exe"
启动执行: start nginx (重载 nginx -s reload 关闭 nginx -s quit)
3 主机IP,域名映射,文件位置 C:\Windows\System32\drivers\etc
4) 启动 应用服务器程序(测试)tomcat,端口8080
访问:http://big.myserver.com:8080
7)访问 Nginx,反向代理到指定应用服务器程序(为了方便此处只启动1个Tomcat)
http://www.nginx.cn/doc/example/loadbanlance.html 负载均衡