Home > Backend Development > PHP Tutorial > Chapter 4, 7 Rewrite Proxy Pattern

Chapter 4, 7 Rewrite Proxy Pattern

WBOY
Release: 2016-07-28 08:25:52
Original
923 people have browsed it

1. Problems to be solved

Putting static content on network storage or content distribution services is a technology that handles load. However, this technique requires you to change the access address of static content on the network storage, and requires modifications to the existing system, such as rewriting the URL address containing the static content or setting up filters for the web server.

2. Instructions for cloud mode

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

3. Implement

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

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

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

  • Apply Auto Scaling to the proxy server when necessary.

4. Configuration

Chapter 4, 7 Rewrite Proxy Pattern

5. Benefits

Use a proxy server to modify the access address so that the access load of static content can be distributed without modifying the existing system.

6. Precautions

  • In order to avoid a single point of failure, you must ensure the redundancy of the proxy server.

  • web/AP servers cannot be directly connected to ELB, so even if the number of web/AP servers (EC2 instances) is increased or decreased through auto scaling, they still cannot be directly connected to ELB.

').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

The above has introduced Chapter 4, 7 Rewrite Proxy Pattern, including relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template