nginx根据域名配置虚拟主机
在配置文件的server段配置server_name参数,
http { server { server_name www.a.com; root /data/webroot/publica; ..... } server { server_name localhost 127.0.0.1 *.b.com root /data/webroot/publicb; } }
然后再操作系统的ip映射文件加上
127.0.0.1 www.a.com 127.0.0.1 www.b.com
相关推荐
AderStep 2020-11-09
zrtlin 2020-11-09
windle 2020-08-15
yserver 2020-08-15
nginxs 2020-11-14
Guanjs0 2020-11-13
小木兮子 2020-11-11
yserver 2020-11-11
ssihc0 2020-11-11
windle 2020-11-10
HanksWang 2020-11-10
liuchen0 2020-11-10
Freshairx 2020-11-10
ccschan 2020-11-10
liwf 2020-11-10
Guanjs0 2020-11-09