Home > Backend Development > PHP Tutorial > Nginx+FastCGI operating principle

Nginx+FastCGI operating principle

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-29 09:15:58
Original
1001 people have browsed it

http://book.51cto.com/art/201202/314840.htm

1.7.2 Nginx+FastCGI operating principle

Nginx does not support direct calling or parsing of external programs. All external programs ( Including PHP) must be called through the FastCGI interface. The FastCGI interface is a socket under Linux (this socket can be a file socket or an ip socket). In order to call a CGI program, a FastCGI wrapper is also needed (a wrapper can be understood as a program used to start another program). This wrapper is bound to a fixed socket, such as a port or file socket. When Nginx sends a CGI request to this socket, the wrapper receives the request through the FastCGI interface, and then spawns a new thread. This thread calls the interpreter or external program to process the script and read the return data; then, the wrapper The returned data is passed to Nginx along the fixed socket through the FastCGI interface; finally, Nginx sends the returned data to the client. This is the entire operation process of Nginx+FastCGI, as shown in Figure 1-3.

Nginx+FastCGI operating principle
(Click to view larger image) Figure 1-3 Nginx+FastCGI running process

The above introduces the operating principle of Nginx+FastCGI, including the relevant aspects. 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