Nginx under Windows Multi-domain simple configuration

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.