1. The directory structure for installing Nginx under Windows is as follows:
2. conf/nginx.conf content under the nginx-1.12.1 directory
#user nobody;worker_processes 1;events { worker_connections 1024;} HTTP { include mime.types; Default_type Application/octet-stream; Sendfile on ; Keepalive_timeout ; server { listen default_server; server_name localhost default_server; root html; Location/{ index index.html index.htm; }} Include: /vhost/*.conf;}
3. a_com.conf content under Vhost directory:
server { listen ; server_name www.a.com; Root d:/test/; Location/{ index index.html index.htm; }}
4. b_com.conf content under Vhost directory:
server { listen ; server_name www.b.com; Root d:/test2/; Location/{ index index.html index.htm; }}
5. Create a new test and test2 directory under the local Disk D drive and create a new index.html file
6. Under C:\WINDOWS\SYSTEM32\DRIVERS\ETC in the Local disk C drive, modify the hosts as follows
127.0.0.1 www.a.com127.0.0.1 www.b.com
7. Use CMD to enter the Nginx installation directory to execute
Nginx.exe start
NGINX-T//Detection syntax
Nginx-s Reload//restart
Nginx-s Stop//stop
8. Open Browser Input URL
Nginx under Windows Multi-domain simple configuration