docker容器实现Nginx的负载均衡

发布时间 2023-05-22 14:19:42作者: 往事已成昨天

准备tomcat   nginx容器: 主机192.168.8.8.200

 mkdir www1

mkdir www2

cd www1

[root@localhost www1]# vi index.jsp //创建文件,写入如下内容
<html>
<head>
<title>Tomcat1</title>
</head>
<body>
<%
out.println("this is Tomcat1");
%>
</body>
</html>
cd www2

[root@localhost www2]# vi index.jsp //写入如下内容
<html>
<head>
<title>Tomcat2</title>
</head>
<body>
<%
out.println("this is Tomcat2");
%>
</body>
</html>