Dynamic/static separation-Nginx + Tomcat

Source: Internet
Author: User
: This article mainly introduces static/dynamic separation-Nginx + Tomcat. For more information about PHP tutorials, see. Static and dynamic content in Web applications are separately placed on different Web servers to process dynamic and static content in a targeted manner to improve performance.
Because Tomcat is weak in concurrent and static resource processing capabilities. Static and dynamic separation is one of the methods. since Tomcat is weak in processing static resources, it will hand over the processing tasks of static resources to appropriate software, so that Tomcat can focus on processing JSP/Servlet requests. For static resource processing server software, we chose Nginx. It supports high concurrency and is highly capable of processing static resources.
In fact, there are many static/dynamic separation solutions. some people use the combination of Apache + Tomcat, while others use the combination of Tomcat + Tomcat. However, two Tomcat servers are placed on different hosts and different domain names respectively. The Apache + Tomcat solution is the same as the Nginx solution in principle. they are based on reverse proxy. compared with the dynamic/static separation using Nginx configuration, Apache configuration is slightly more complex.

Prerequisites: you have a primary domain name server in the Tomcat + JDK environment.

Set subdomain name

The IP host pointed to by the subdomain name stores static resources.

Configure resolution for HiChina second-level domain names

Install Nginx

  1. Environment required for nginx installation, pcre (for rewrite), zlib (for compression), ssl

    yum -y install zlibyum –y install pcreyum –y install openssl  
  2. Download and install nginx-* .tar.gz
    Download nginx-1. * .tar.gz

    Tar-zxvf nginx-1.2.8.tar.gz-C ./
    Cd nginx-1.2.8
    ./Congigure-prefix =/usr/local/nginx
    Make & make install

To be continued

Reference URL

Dynamic/static separation and load balancing using Nginx
CentOS + Nginx step by step to configure server load balancer
Nginx Reverse proxy and server load balancer Deployment Guide

'). AddClass ('pre-numbering '). hide (); $ (this ). addClass ('Has-numbering '). parent (). append ($ numbering); for (I = 1; I <= lines; I ++) {$ numbering. append ($ ('
  • '). Text (I) ;}; $ numbering. fadeIn (1700) ;}) ;}; script

    The above introduces the dynamic and static separation-Nginx + Tomcat, including the content, hope to be helpful to friends who are interested in PHP tutorials.

    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.