Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to configure Nginx multiple domain names under windows

Shulou Source: shulou.com Published: 2022-05-31 12:31:02 10月02日 Update

This article mainly explains "how to configure Nginx multiple domain names under windows". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to configure Nginx multi-domain names under windows".

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 dappled to Testbank; location / {index index.html index.htm;}}

4. B_com.conf content under vhost directory:

Server {listen 80; server_name www.b.com; root dappled to Test2; location / {index index.html index.htm;}}

5. Create a new test and test2 directory and a new index.html file under the local disk d disk

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

Thank you for your reading. The above is the content of "how to configure Nginx multiple domain names under windows". After the study of this article, I believe you have a deeper understanding of how to configure Nginx multi-domain names under windows, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Directory content multiple domain names configuration learning disk that is ideas situations files articles more browsers knowledge points articles structure URL grammar follow Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Xiaomi Huawei macOS Shulou Technology