Recall & Review
beginner
What is virtual hosting in web servers?
Virtual hosting allows a single web server to host multiple domain names or websites on the same IP address.
Click to reveal answer
beginner
Why do we use virtual hosting to serve multiple domains?
To save resources by using one server and IP address to handle many websites, making hosting efficient and cost-effective.
Click to reveal answer
intermediate
How does nginx know which website to serve when multiple domains use virtual hosting?
Nginx uses the 'server_name' directive to match the requested domain and serve the correct website content.
Click to reveal answer
intermediate
What is the difference between IP-based and name-based virtual hosting?
IP-based uses different IP addresses for each domain; name-based uses the same IP but distinguishes domains by their names.
Click to reveal answer
beginner
How does virtual hosting relate to real-life apartment buildings?
Like one building with many apartments, virtual hosting lets one server host many websites, each with its own address (domain).
Click to reveal answer
What directive does nginx use to serve different websites on the same server?
✗ Incorrect
The 'server_name' directive tells nginx which domain name to respond to for each website.
Why is virtual hosting useful?
✗ Incorrect
Virtual hosting lets one server handle many domains, saving resources and costs.
Which type of virtual hosting uses the same IP address for multiple domains?
✗ Incorrect
Name-based virtual hosting uses one IP address and distinguishes domains by their names.
If two domains share one IP address, how does nginx serve the correct site?
✗ Incorrect
Nginx reads the domain name sent by the browser to decide which site to serve.
What is a real-life example similar to virtual hosting?
✗ Incorrect
An apartment building hosts many apartments at one address, like one server hosting many domains.
Explain how virtual hosting allows one server to serve multiple websites.
Think about how nginx uses domain names to decide which website to show.
You got /4 concepts.
Describe the difference between IP-based and name-based virtual hosting.
Consider how the server identifies the website to serve.
You got /3 concepts.