Nginx负载均衡-window服务器

1.nginx官网

http://nginx.org/en/download.html 解压双击nginx.exe文件,服务开启,nginx启动

启动后,查看应用进程

Nginx负载均衡-window服务器

2.打开nginx-1.14.0/conf/nginx.conf,进行配置

①上传文件限制

Nginx负载均衡-window服务器

②负载均衡配置

Nginx负载均衡-window服务器

3.配置tomcat,server.xml

①配置关闭端口(同一服务器上需要修改)

Nginx负载均衡-window服务器

②配置http端口

其中proxyPort是解决项目重定向问题,tomcat处理完请求丢失端口,指定其代理端口

Nginx负载均衡-window服务器

③开启集群

Nginx负载均衡-window服务器

④配置tomcat默认访问的项目路径

Nginx负载均衡-window服务器