Home  >  Article  >  Operation and Maintenance  >  How nginx and php handle user requests

How nginx and php handle user requests

王林
王林Original
2019-10-19 15:21:203242browse

How nginx and php handle user requests

Nginx and PHP process user request steps:

1. The client (browser) makes a request operation (enter the URL, click the link ,submit Form).

2. The client resolves the domain name and requests the IP address from the set DNS server.

3. The client uses the three-way handshake to establish a TCP/IP connection with the server based on the IP address returned by the DNS server.

4. After the TCP/IP connection is successful, the client sends an HTTP request to the server.

5. The server-side Web Server will determine the resource type of the HTTP request and perform content distribution processing; if the requested resource is a PHP file, the server-side software will start the corresponding CGI program for processing and return the processing result.

6. The server responds to the client with the processing results of the Web Server. The client receives the response from the server and renders the processing results. If the response content requires requesting other static resources, access the required resources through CDN to accelerate access.

7. The client presents the rendered view and disconnects the TCP/IP connection.

Recommended tutorial: Nginx tutorial

The above is the detailed content of How nginx and php handle user requests. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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
Previous article:Nginx control of trafficNext article:Nginx control of traffic