Locate nginx.conf under the Conf file in the Nginx root directory, and edit
Configure the server IP and port number before server{}
Such as:
Upstream Local_tomcat {
Local_tomcat for the access path, configure the server IP and port number below, you can also assign weights (weight==? )
Server 127.0.0.1:8080; #权重
Server 127.0.0.1:8081; #权重
}
server {
Listen 80; #端口
server_name localhost; #ip
#charset Koi8-r;
#access_log Logs/host.access.log Main;
Location/{
root HTML;
Index index.html index.htm;
}
# All static requests are handled by Nginx, and directories are stored in HTML
Location ~ \. (GIF|JPG|JPEG|PNG|BMP|SWF|JS|CSS) $ {
root HTML;
}
# All dynamic requests are forwarded to Tomcat processing
location/store_v2.0 {
---------------Configure the access path here-------------
Proxy_pass Http://local_tomcat;
}
Finally, don't forget to configure <distributable/> in the XML of the project
As well as modify the Tomcat conf file under the Server.xml 134 line of <cluster classname= "Org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
The wrong place everyone, you can leave a message below
Nginx configuration server cluster, load balancer