Nginx learning (1)

Source: Internet
Author: User
: This article mainly introduces nginx learning (1). If you are interested in the PHP Tutorial, refer to it. Recently, I started CDN-related services. The backend is all nginx-related knowledge. for example, all website caches are structured on nginx servers, all functions such as server load balancer are supported by nginx.

Many access control policies need to adopt nginx embedded lua. In addition, there are a lot of logic and services about CDN that need to be customized and developed on nginx, therefore, understanding nginx is the basis for in-depth development of CDN services.

So I plan to take some time to learn and develop the business, and record the overall learning experience, hoping to have a better understanding of nginx.

The current understanding of nginx is limited to the following:

  • 1 nginx is a high-performance WEB server based on the event-driven C/S architecture open-source architecture of Russian Daniel. it mainly supports HTTP and mail-related protocols.
  • 2 nginx has the best performance in WEB servers. Although the market share is only ranked second, the first place is apache in the java world.
  • 3 Currently, almost all of the mainstream CDN services in China are based on nginx.
  • 4 nginx is very powerful and supports many features, such as forward proxy, reverse proxy, cache, and load balancing.
  • 5 nginx can support lua extension, and can load the lua interpreter internally to perfectly match the lua language. Currently, all the functions are completed in the lua script.
  • 6. nginx adopts the multi-process management mode. one master manager has zero to multiple worker processes. all specific services are completed by a specific worker. The master is only responsible for management and scheduling.
  • 7. nginx uses pipelines to process message streams. the processing process is divided into 11 stages. each message is executed in one stage and one stage in sequence, when a stage does not meet the conditions, it will end early. The three most famous stages are rewrite, access, and content. Rewrite is to internally process the url, including checking, modifying attributes, and redirecting again. access is mainly used to implement access control, and content is the final content to be sent to the user.
  • 8 nginx has many internal data structures, including strings, linked lists, hash, and radix_tree (previously used). it is best to master these data structures.
  • 9 There is an open-source project called openresty, which contains the core of nginx and common third-party modules. for quick setup, refer.

The above introduces nginx learning (1), including some content. I hope to help anyone who is interested in the PHP Tutorial.

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.