国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網站 > Nginx > 正文

windows下Nginx多域名簡單配置教程

2024-08-30 12:21:43
字體:
來源:轉載
供稿:網友
這篇文章主要為大家詳細介紹了windows下Nginx多域名簡單配置教程,具有一定的參考價值,感興趣的小伙伴們可以參考一下

本文實例為大家分享了Nginx多域名的簡單配置教程,供大家參考,具體內容如下

1. windows下安裝nginx的目錄結構如下:

2. 在nginx-1.12.1目錄下conf/nginx.conf 內容

#user nobody;worker_processes 1;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. vhost 目錄下 a_com.conf 內容:

server {    listen    80;    server_name www.a.com;    root  D:/test/;    location / {      index index.html index.htm;    }}

4. vhost 目錄下 b_com.conf 內容:

server {    listen    80;    server_name www.b.com;    root  D:/test2/;    location / {      index index.html index.htm;    }}

5. 在本地磁盤D盤下 新建 test 和 test2目錄,并新建 index.html文件

6. 在本地磁盤C盤中C:/Windows/System32/drivers/etc 下修改hosts 如下

127.0.0.1    www.a.com127.0.0.1    www.b.com

7. 用cmd進入nginx安裝目錄下執行

    nginx.exe  開始   

    nginx -t  //檢測語法

    nginx -s reload  //重新啟動

    nginx -s stop  //停止

8. 打開瀏覽器輸入網址

github倉庫:https://github.com/chengzao

武林網之家提示您:這篇文章你看完了!

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 巩留县| 金寨县| 阿尔山市| 桂平市| 乌苏市| 和田市| 湖南省| 迭部县| 普陀区| 呼玛县| 南雄市| 五原县| 鄄城县| 景宁| 德州市| 枝江市| 康马县| 皮山县| 兴业县| 柘荣县| 鲜城| 垦利县| 牟定县| 曲阳县| 静安区| 靖江市| 娄底市| 道孚县| 曲麻莱县| 邯郸县| 化德县| 武山县| 银川市| 湾仔区| 潼关县| 禄劝| 周宁县| 沙洋县| 腾冲县| 松潘县| 玉环县|