4th 7 Rewriting the proxy pattern (Rewrite)

Source: Internet
Author: User
1. The problem to be resolved

Placing static content on a networked storage or content distribution service is a technology that handles the load. However, this technique requires you to change the access address of the static content on the network storage and to modify the existing system, such as rewriting the URL address that contains the static content or setting a filter (filters) for the Web server.

2. Description of Cloud Mode

You can change the access address by using a proxy server without modifying the existing system. Set up a proxy server to change the access address of the static content to the address of the network store or content distribution service before the server where the content is saved.

3. Implementation

Use commonly used software like Apache or Nginx to build a proxy server, and then place the proxy server in front of the existing system.

    • Run a proxy server that can rewrite content (for example, Nginx) on a EC2 instance and place the proxy server between Elb and S3 (for static content).

    • Add a proxy server rule to modify the URL of the specified content.

    • If necessary, apply auto Scaling to the proxy server.

4. Configuration

5. Benefits

Using a proxy server to modify the access address allows you to allocate the access load for static content without modifying the existing system.

6. Precautions

    • In order not to generate a single point of failure, you must ensure that the proxy server is redundant.

    • Web/ap servers cannot be directly connected to ELB, so even if you increase or decrease the number of WEB/AP servers (EC2 instances) through auto scaling, they still cannot connect directly to Elb.

'). addclass (' pre-numbering '). Hide (); $ (this). addclass (' has-numbering '). Parent (). append ($numbering); for (i = 1; i <= lines; i++) {$numbering. Append ($ ('
  • '). Text (i)); }; $numbering. FadeIn (1700); }); });

    The above is introduced in the 4th chapter, 7 rewrite proxy mode (Rewrite proxy pattern), including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

  • 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.