nginx 配置 tomcat集群

在 nginx/conf/nginx.cong 或 etc/nginx/nginx.conf

# 定义包含多个应用的url的变量
upstream server_list {    
    server url1 ;
    server url2;
}

server {
    listen        80;
    server_name    lovalhost;

    location / {
        root    html;
        proxy_pass    http://server_list;
        #  从定向到定义的 url 列表
    }
}

tomcat 集群

tomcat 通过广播机制统一sessionid(不推荐,推荐用redis)

在 server.xml 中添加  <Cluster/>

在 web.xml 中添加 <distributable/>

猜你喜欢

转载自www.cnblogs.com/zhangzixian/p/12059971.html