場景說明: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 負載均衡