神剑山庄资源网 Design By www.hcban.com
本文实例为大家分享了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.com 127.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
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。
标签:
windows,Nginx,域名
神剑山庄资源网 Design By www.hcban.com
神剑山庄资源网
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
神剑山庄资源网 Design By www.hcban.com
暂无windows下Nginx多域名简单配置教程的评论...
更新日志
2024年09月23日
2024年09月23日
- 【中国音乐】盛中国《新疆之春》2004[FLAC+CUE]
- 群星《音你而来 第8期》[320K/MP3][44.64MB]
- 群星《音你而来 第8期》[FLAC/分轨][121.21MB]
- 群星《十二女声Ⅲ》[WAV/CUE/分轨][626.4MB]
- 陈百强.1993-离不开...纪念歌集2CD【华纳】【WAV+CUE】
- 于台烟.2003-爱自己【乾坤唱片】【WAV+CUE】
- 群星.2024-我们永远是我们电影原声带【乐禾发文化】【FLAC分轨】
- 【中国民乐】张维良《秋江夜泊》2004[FLAC+CUE]
- 明达年度发烧碟MasterSuperiorAudiophile2011[DSF]
- 明达年度发烧碟MasterSuperiorAudiophile2017[DSF]
- 翁立友.2008-恨孤单【大旗】【WAV+CUE】
- 群星.2009-Magic.Cover日粤精华3CD【环球】【WAV+CUE】
- 华少翌.2005-华少翌【中唱艺能】【WAV+CUE】
- 群星《十二女声Ⅱ》[WAV/CUE/分轨][527MB]
- 大自然音乐系列《漫步在山裡》[WAV/CUE/分轨][502.8MB]