Nginx简单配置几个基于端口的虚拟主机
nginx.conf中,一个server段对应一个虚拟主机,如果要增加多个虚拟主机,增加多个server段即可。
server { listen 8001; access_log logs/8001.log; location / { root html/8001; index index.html; } } server { listen 8002; access_log logs/8002.log; location / { root html/8002; index index.html; } } server { listen 8003; access_log logs/8003.log; location / { root html/8003; index index.html; } }
--END-- 2019-12-17 17:28