Still trying to learn Nginx? This 1330-page Nginx notes, subvert your understanding of Nginx learning!

Nginx  (engine x) is a high-performance HTTP and reverse proxy web server, and also provides IMAP/POP3/SMTP services. Nginx was developed by Igor Sesoyev for the second most visited site in Russia, Rambler.ru (Russian: Рамблер). The first public version 0.1.0 was released on October 4, 2004.

It releases its source code in the form of a BSD-like license, and is known for its stability, rich feature set, sample configuration files and low system resource consumption. On June 1, 2011, nginx 1.0.4 was released.

Nginx is a lightweight web server/reverse proxy server and email (IMAP/POP3) proxy server, issued under the BSD-like protocol. Its characteristics are that it occupies less memory and has strong concurrency capabilities. In fact, nginx's concurrency capabilities perform better in the same type of web server. Users of nginx websites in mainland China include: Baidu, Jingdong, Sina, Netease, Tencent, Taobao, etc. Nginx is so important, it can’t be bypassed, and it’s so difficult, but it doesn’t change much after the trip, and the benefits are getting bigger and bigger. Then why not write a document to give you some lessons to learn from, and help you master Nginx as soon as possible? This article will help readers master it.

Get in the car quickly and be ready to subvert your perception.

Nginx as a load balancing service: Nginx can directly support Rails and PHP programs internally for external services, and can also support external services as an HTTP proxy service. Nginx is written in C, and it is much better than Perlbal in terms of system resource overhead and CPU usage efficiency. For those who are focused on work but have not yet mastered Nginx, don’t worry, this article will help you master Nginx.

The 1,399 pages of Nginx notes bought by Dangdang.com 266, it turns out that I don’t even get started

 

This article will introduce the structure of the three parts from the table of contents, the main content and the summary. I hope you will like it! !

table of Contents

The 1,399 pages of Nginx notes bought by Dangdang.com 266, it turns out that I don’t even get started

 

main content

  This book consists of three parts, dedicated to explaining the necessary knowledge for developing Nginx modules. After the first edition is released, it is deeply loved by readers. However, due to the multitude of functions and powerful performance of Nginx, the basic skills that must be understood are also very complicated. The first edition was written in a hurry and several advanced skills descriptions were missing. Therefore, the second edition was improved on this basis. The book first introduces the basic usage and configuration rules of official Nginx to help readers understand the usage of general Nginx modules, and then focuses on how to develop HTTP modules (including HTTP filtering modules) to obtain customized Nginx, including the development of a complex function The module needs to understand all kinds of knowledge, and the implementation details of the memory pool and the TCP protocol are introduced in detail; then, the Nginx framework code is integrated to analyze the design concepts and skills of the Nginx architecture. In addition, how to use the module It supports HTTP variables and shared memory with slab. It is believed that through improvement, it can further help readers to better develop Nginx modules with rich functions and first-class performance.

The first part is aimed at junior readers and introduces the basic knowledge of Nginx on obtaining compilation and running.

The 1,399 pages of Nginx notes bought by Dangdang.com 266, it turns out that I don’t even get started

 

This chapter mainly introduces the following content to readers

Chapter 1 Preparatory work before studying Nginx: What is Nginx? What are its characteristics? What are the reasons for choosing Nginx? How to compile and install Nginx? What kind of thinking is hidden behind this installation method? This chapter will Answer the above questions.

The 1,399 pages of Nginx notes bought by Dangdang.com 266, it turns out that I don’t even get started

 

Chapter 2 Nginx Configuration: Through the study of this chapter, readers can: Configure a static Web server proficiently: Have a deep understanding of various configuration items that affect the performance of the Web server: Have a comprehensive understanding of configuration syntax. Get the configuration instructions of any module through the Internet or other means, and then you can use the functions of these modules by modifying the nginx.conf file.

The 1,399 pages of Nginx notes bought by Dangdang.com 266, it turns out that I don’t even get started

 

The second part is aimed at intermediate readers, with an example as the main line, telling readers how to develop an http module. Readers of this part do not need to understand the details of Nginx, but only need to know how to implement a basic http module.

The 1,399 pages of Nginx notes bought by Dangdang.com 266, it turns out that I don’t even get started

 

This chapter mainly introduces the following content to readers

Chapter 3 Develop a simple HTTP module: This chapter will not discuss in depth how the HTTP module and the core modules of Nginx work together, and each interface mentioned in this part will only involve usage and not implementation principles. In Part 3, we will further elaborate on how many of the interfaces mentioned in this chapter implement asynchronous access.

The 1,399 pages of Nginx notes bought by Dangdang.com 266, it turns out that I don’t even get started

 

Chapter 4 Configuration, Error Log and Request Context: When writing a fully asynchronous HTTP module, there must be a context to maintain the necessary information for a request. In section 4.5, first discuss the context of the request and the fully asynchronous implementation of the Nginx service And how to use the HTTP context, and then briefly describe how the HTTP framework manages the context structure of the request.

The 1,399 pages of Nginx notes bought by Dangdang.com 266, it turns out that I don’t even get started

 

Chapter 5 Accessing Third-Party Services: This chapter still uses the mytest module as an example to explain, but it will expand the functions of mytest. Note that the code not mentioned in the article (such as defining the nytest module) is exactly the same as in Chapter 3.

The 1,399 pages of Nginx notes bought by Dangdang.com 266, it turns out that I don’t even get started

 

Chapter 6 Develop a simple HTTP filter module: This chapter begins to introduce how to develop an HTTP filter module.

The 1,399 pages of Nginx notes bought by Dangdang.com 266, it turns out that I don’t even get started

 

Chapter 7 Advanced Data Structures Provided by Nginx: This chapter will introduce the 6 basic containers implemented by Nginx. The proficient use of these 6 basic containers will greatly improve the efficiency of developing Nginx modules and make it easier to implement complex functions.

The 1,399 pages of Nginx notes bought by Dangdang.com 266, it turns out that I don’t even get started

 

The third part is aimed at advanced readers. This is the focus of this book. It thoroughly analyzes the Nginx architecture, deeply explores the purpose and significance of various designs of Nginx, and explores the code design and implementation of some of the features used in the second part. After reading this section, readers will have a clear understanding of the entire Nginx architecture, and can write various modules (not limited to http modules) and insert them into Nginx to customize their own Nginx.

The 1,399 pages of Nginx notes bought by Dangdang.com 266, it turns out that I don’t even get started

 

This chapter mainly introduces the following content to readers

Chapter 8 Nginx Infrastructure: In the second part of this book, we have learned how to develop HTTP modules, which allows us to achieve high-performance, customized Web server functions.

The 1,399 pages of Nginx notes bought by Dangdang.com 266, it turns out that I don’t even get started

 

Chapter 9 Event Module: This chapter will comprehensively explore how Nginx's event-driven mechanism works.

The 1,399 pages of Nginx notes bought by Dangdang.com 266, it turns out that I don’t even get started

 

Chapter 10: Initialization of HTTP Framework: Starting from this chapter, we will discuss the HTP module, a major player in event consumption modules. As a web server, Nginx has more HTTP modules than the other four types of modules (core module, event module, configuration module, email Module), its code size is also far ahead.

The 1,399 pages of Nginx notes bought by Dangdang.com 266, it turns out that I don’t even get started

 

Chapter 11 HTTP Framework Execution Process: This chapter will introduce the dynamic HTTP framework, mainly discussing how the event-driven HTTP framework handles network events during the request life cycle and how to integrate various HTTP modules to jointly process HTTP requests. At the same time, it will also introduce multiple non-blocking asynchronous methods to simplify the development of HTTP modules.

The 1,399 pages of Nginx notes bought by Dangdang.com 266, it turns out that I don’t even get started

 

Chapter 12 Design and Implementation of Upstream Mechanism: This chapter will discuss the design and implementation of ustream mechanism to help readers fully understand how to use upstream to visit upstream servers.

The 1,399 pages of Nginx notes bought by Dangdang.com 266, it turns out that I don’t even get started

 

Chapter 13 Mail Proxy Module: This chapter first introduces what the mail proxy function does, and then it will analyze how Nginx implements the mail proxy function.

The 1,399 pages of Nginx notes bought by Dangdang.com 266, it turns out that I don’t even get started

 

Chapter 14 Communication Mechanism Between Processes: This chapter is not to explain which process communication methods Linux F has, but to explain which methods Nginx chooses to communicate data between the Bmaster process and multiple worker processes, and how the Nginx framework is repackaged These inter-process communication methods

The 1,399 pages of Nginx notes bought by Dangdang.com 266, it turns out that I don’t even get started

 

Chapter 15 Variables: Nginx has many functions embodied in the scripted configuration file of nginx.com. The formats and styles of these configuration items are various. The reason is that they are all customized by each Nginx module, and there is no uniformity. Standard, which has been mentioned in Chapter 4.

The 1,399 pages of Nginx notes bought by Dangdang.com 266, it turns out that I don’t even get started

 

Chapter 16 slab shared memory: In addition to explaining how to use it, this chapter will also introduce the implementation principle in detail, from which we can discover its original design and unsuitable scenarios. The source code implemented by Slab is very efficient, but it is also a bit jerky. This chapter will explain various binary bit operations more through the source code to help readers learn the coding art of slab.

The 1,399 pages of Nginx notes bought by Dangdang.com 266, it turns out that I don’t even get started

 

This [In-depth understanding of Nginx module development and architecture analysis] document has a total of 1330 pages. Friends who need the full version and the assistant VX below can get it for free!

Of course, the documentation alone is not enough. There are also videos and matching courseware for learning improvement. Try to understand Nginx and the network. I believe there will be an extraordinary life! !

TCP/IP/Nginx learning video

The 1,399 pages of Nginx notes bought by Dangdang.com 266, it turns out that I don’t even get started

 

There are also courseware sharing

The 1,399 pages of Nginx notes bought by Dangdang.com 266, it turns out that I don’t even get started

 

High concurrency, load balancing, high availability

The 1,399 pages of Nginx notes bought by Dangdang.com 266, it turns out that I don’t even get started

 

HTTP protocol

The 1,399 pages of Nginx notes bought by Dangdang.com 266, it turns out that I don’t even get started

 

The 1,399 pages of Nginx notes bought by Dangdang.com 266, it turns out that I don’t even get started

 

Load balancing

The 1,399 pages of Nginx notes bought by Dangdang.com 266, it turns out that I don’t even get started

 

The 1,399 pages of Nginx notes bought by Dangdang.com 266, it turns out that I don’t even get started

 

Friends who need TCP/IP/Nginx learning videos and courseware can receive them for free with the assistant VX below!

Okay, I’m sharing it here today. I hope everyone can study hard and improve the computer network. I also hope that this article will be liked by everyone! !

Guess you like

Origin blog.csdn.net/GYHYCX/article/details/109261020