The nginx.conf file in the/usr/local/nginx/conf directory is the nginx configuration file.
1 Configuring virtual machines with Nginx
1.1 Differentiating virtual machines by port
Add a server node to the nginx.conf file and modify the port number to
server { listen Bayi; server_name localhost; #charset Koi8-r; # # #access_log logs/host.access.log main; # location /{ root html81; Index index.html index.htm; } }
http://192.168.81.128:81/
Access the index.html file under the html81 folder
1.2 Differentiating virtual machines by domain name
Here we can complete the task of domain name resolution by modifying the IP address of the domain name specified by the host file
Host file location: C:\Windows\System32\drivers\etc
The nginx.conf configuration file needs to be modified.
The configuration file needs to be reloaded after the configuration is modified.
At this point access
www.taobao.com/
Access is the index.html under the Html-taobao folder
Configuration of Nginx