1. Download and configure the necessary files
- Download Nginx:http://nginx.org/download/nginx-1.6.2.zip
- Download Tomcat: Http://mirror.bit.edu.cn/apache/tomcat/tomcat-8/v8.0.12/bin/apache-tomcat-8.0.12-windows-x64.zip
2. Unzip the download file
Unzip N Ginx-1.6.2.zip to the E:\nginx-1.6.2 directory:
Unzip Apache-tomcat-8.0.12-windows-x64.zip to the E:\apache-tomcat-8.0.12 directory:
The above directory is my extracted directory, specific to which directory, according to the actual situation to modify.
3. Configuring Tomcat
Locate the tomcat configuration file E:\apache-tomcat-8.0.12\conf\server.xml configuration file
Find the following :
If 8005 and 8080 are occupied, they are modified to other unoccupied ports, which need to be used later
Duplicate a copy of Tomcat in the sibling directory : E:\apache-tomcat-8.0.13 I'm here to change 2 to 3. , and modify the configuration file :
After modifying ports that are not occupied by the upper port, here I change to 8006 and 8088
- Configure Nginx
Locate the E:\nginx-1.6.2\conf\nginx.conf configuration file
On #gzip; The following configuration is added after this line
Here I set the nginx port for the
- Test
Launch two tomcat instances separately, running E:\apache-tomcat-8.0.12\bin\startup.bat and e:\ directly Apache-tomcat-8.0.13\bin\startup.bat
Then start nginxand run E:\nginx-1.6.2\nginx.exe directly.
Then enter in the browser : Http://localhost:800 The following results will appear, stating that your configuration was successful :
Nginx+tomcat cluster configuration under Windows