- 使用一台虚拟机,安装一个nginx,2个tomcat.
- nginx的配置文件如下:
upstream tomcats{
server 192.168.1.101:8080;
server 192.168.1.101:8081;
}
server {
listen 80;
server_name www.ttba.com;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
proxy_pass http://tomcats;
index index.html index.htm;
}
}
- 运行效果图。