Nginx simplest reverse proxy server load balancer configuration test

Source: Internet
Author: User
& Nbsp; 1. & nbsp; front-end description: my Nginx version is 0.7.63 and is installed in/usr/local/nginx. the default port is 80, the Nginx startup, shutdown, restart, and reload configuration files are rewritten and put under/usr/local/nginx/sbin/, named nginxbak. sh. & Nbsp; & 1. note: my Nginx version is 0.7.63 and is installed in/usr/local/nginx. the default port is 80, the Nginx startup, shutdown, restart, and reload configuration files are rewritten and put under/usr/local/nginx/sbin/, named nginxbak. sh.
 

 

Resin uses 3.1.10, installed in/usr/local/resin-3.1.10, and Port 8081.

Tomcat is installed in/usr/local/apache-tomcat-6.0.29 and the port is set to 8080.

2. create a simple web project named NginxTest

 

Index. jsp The content in is to print a sentence, to distinguish which backend server is accessed by the request,

The difference in a statement is the server's word recognition.

 

3.Set NginxTest The project is uploaded to the virtual server and deployed to the corresponding backend server. Their configurations are as follows:

Tomcat:

Resin:

Modify Hosts File:

192.168.1.86 nginx.digu.com

Start separately Tomcat (startup. sh) And Resin (httpd. sh start) , In the browser to check whether it is accessible:

4.SetTomcat , Resin As Nginx Backend server, configure a simple server cluster to demonstrate its load balancing situation.

Nginx The configuration file is as follows:

  1. User root;
  2. Worker_processes1;
  3. Error_log logs/error. log;
  4. # Error_log logs/stdout. log notice;
  5. # Error_log logs/stdout. log info;
  6. Pid logs/nginx. pid;
  7. Events {
  8. Use epoll;
  9. Worker_connections1024;
  10. }
  11. Http {
  12. Include mime. types;
  13. Default_type application/octet-stream;
  14. Sendfile on;
  15. # Tcp_nopush on;
  16. # Keepalive_timeout0 </
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.