A tutorial on simple configuration of Nginx Multi-domain names under windows
This article gives you an example to share a simple Nginx multi-domain name configuration tutorial for your reference. The details are as follows.
1. The directory structure for installing nginx under windows is as follows:
two。 Conf/nginx.conf content in the nginx-1.12.1 directory
# user nobody;worker_processes 1 vhost/*.conf; events {worker_connections 1024;} http {include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server {listen 80 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 80; server_name www.a.com; root DGV server_name www.a.com; root TestAccord; location / {Testi}}
4. B_com.conf content under vhost directory:
Server {listen 80; server_name www.b.com; root DVUR to Test2; location / {index index.html index.htm;}}
5. Create a new test and test2 directory under the local disk D, and create a new index.html file
6. Modify the hosts under C:\ Windows\ System32\ drivers\ etc on the local disk C 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 / / check syntax
Nginx-s reload / / restart
Nginx-s stop / / stop
8. Open the browser and enter the URL
Github warehouse: https://github.com/chengzao
The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.