• What happens when users visit the Nginx site?

This article from the front end to the background server access process, a brief introduction to the steps of accessing a Nginx website.

  • Let’s draw a picture

  1. For example, a user initiates a request from a browserapi.izqy.topIs accessed by the browser firstThe DNS serverThe queryapi.izqy.topThe corresponding IP
  2. IP address to be queried by the DNS server47.106.240.108Back to the browser
  3. The browser will carry“Domain name”Information and ** “request” ** information are sent to47.106.240.108For the server for the80The process in which the port resides (in this case, the Nginx process uses port 80 by default)
  4. nginxWhen the process receives the requested information, it first looks it up from its own configuration information table“Domain name”informationapi.izqy.topIf multiple reverse proxy services exist, select the reverse proxy service based on the corresponding load balancing rules
  5. Based on the obtained reverse proxy service information, ** “request” information is sent to the selected reverse proxy service
  6. The service processes ** “requests” ** information and returns it when it’s donenginx
  7. nginxThe information returned by the service is forwarded to the browser
  8. The browser parses the returned information and presents it to the user