RuVirtualHosts
袧邪褋褌褉邪懈胁邪褌褜 胁懈褉褌褍邪谢褜薪褘械 褋械褉胁械褉邪 芯褔械薪褜 锌褉芯褋褌芯. 袙 泻邪卸写芯屑 褋械褉胁械褉械 薪褍卸薪芯 芯锌懈褋邪褌褜 胁褋械 邪写褉械褋邪 懈 锌芯褉褌褘, 薪邪 泻芯褌芯褉褘褏 薪褍卸薪芯 锌褉懈薪懈屑邪褌褜 褋芯械写懈薪械薪懈褟 写谢褟 褝褌芯谐芯 褋械褉胁械褉邪, 懈 胁褋械 懈屑械薪邪 褋械褉胁械褉芯胁. 袪邪褋褋屑芯褌褉懈屑 褋谢械写褍褞褖褍褞 泻芯薪褎懈谐褍褉邪褑懈褞:
: http { : server { : listen 192.168.10.1; : listen 192.168.10.1:8000; : server_name one.example.com www.one.example.com; : ... : } : server { : listen 192.168.10.1; : listen 192.168.10.2:8000; : listen 9000; : server_name two.example.com www.two.example.com : three.example.com www.three.example.com; : ... : } : server { : listen 9000; : server_name four.example.com www.four.example.com; : ... : } : }
袩褉懈 褌邪泻芯泄 薪邪褋褌褉芯泄泻械 蟹邪锌褉芯褋, 锌褉懈褕械写褕懈泄 薪邪 192.168.10.1:80 褋 蟹邪谐芯谢芯胁泻芯屑 "Host: www.three.example.com", 斜褍写械褌 芯斜褋谢褍卸械薪 胁褌芯褉褘屑 褋械褉胁械褉芯屑. 袝褋谢懈 胁 蟹邪锌褉芯褋械 薪械褌 蟹邪谐芯谢芯胁泻邪 "Host" 懈谢懈 卸械 胁 薪褢屑 褍泻邪蟹邪薪芯 懈屑褟, 薪械芯锌懈褋邪薪薪芯械 薪懈 胁 芯写薪芯屑 褋械褉胁械褉械, 褋谢褍褕邪褞褖械屑 薪邪 邪写褉械褋械 懈 锌芯褉褌褍, 薪邪 泻芯褌芯褉褘械 锌褉懈褕褢谢 蟹邪锌褉芯褋, 褌芯 蟹邪锌褉芯褋 斜褍写械褌 芯斜褋谢褍卸械薪 褋械褉胁械褉芯屑, 褍 泻芯褌芯褉芯谐芯 锌械褉胁褘屑 芯锌懈褋邪薪褘 褝褌懈 邪写褉械褋 懈 锌芯褉褌. 袧邪锌褉懈屑械褉, 胁褋械 蟹邪锌褉芯褋褘 斜械蟹 蟹邪谐芯谢芯胁泻邪 "Host", 锌褉懈褕械写褕懈械 薪邪 9000 锌芯褉褌, 斜褍写褍褌 芯斜褋谢褍卸械薪褘 胁褌芯褉褘屑 褋械褉胁械褉芯屑 (two.example.com). 孝芯 卸械 褋邪屑芯械 锌褉芯懈蟹芯泄写褢褌 懈 褋 蟹邪锌褉芯褋芯屑 褋 蟹邪谐芯谢芯胁泻芯屑 "Host: www.one.example.com", 锌褉懈褕械写褕懈屑 薪邪 9000 锌芯褉褌. 袛谢褟 谐懈斜泻芯泄 薪邪褋褌褉芯泄泻懈 褋械褉胁械褉芯胁 锌芯 褍屑芯谢褔邪薪懈褞 屑芯卸薪芯 懈褋锌芯谢褜蟹芯胁邪褌褜 锌邪褉邪屑械褌褉 default 胁 写懈褉械泻褌懈胁械 listen.