In linux, The nginx configuration section Nginx configuration section Event {// generally configures the nginx process and connection features. // For example, worker_connections 1024 works simultaneously; // This indicates that a sub-process can connect up to 1024 connections} http {// This is the main segment of the http server configured Server1 {// This is the virtual host segment Location {// Location, locate a special path or file again, for example, the image directory is processed separately} // for example. php processing separately} Server2 {}} Example 1: domain name-based virtual host server {listen 80; # listening port server_name a.com; # monitor domain name location/{root/var/www/a.com; # locate index index.html in the root directory;} Example 2: configure server {listen 8080; server_name 192.168.1.204 for Port-based virtual hosts; location/{root/var/www/html8080; index index.html ;}}