CentOS6.5 简单配置Nginx + tomcat

时间:2023-03-09 05:51:04
CentOS6.5 简单配置Nginx + tomcat

1、配置nginx.conf

vi /usr/local/nginx/conf/nginx.conf   --这是你的安装目录

CentOS6.5 简单配置Nginx + tomcat

注:红框地方为任意位置,server在配置文件中已存在

我使用的是两个tomcat,为8080端口和8090端口,这个简单的配置没有设置session共享

2、重启nginx

/usr/local/nginx/sbin/nginx -s reload

访问会发现在两个不同的tomcat,每刷新一次切换一次