Recall & Review
beginner
Why use separate config files for each site in nginx?
Using separate config files helps organize settings, makes it easier to manage multiple sites, and allows enabling or disabling sites without affecting others.
Click to reveal answer
beginner
Where are separate site config files usually stored in nginx?
They are typically stored in the
/etc/nginx/sites-available/ directory, with symbolic links in /etc/nginx/sites-enabled/ to activate them.Click to reveal answer
intermediate
What command activates a site config in nginx when using separate files?
You create a symbolic link from
/etc/nginx/sites-available/your-site to /etc/nginx/sites-enabled/your-site using ln -s /etc/nginx/sites-available/your-site /etc/nginx/sites-enabled/your-site.Click to reveal answer
beginner
How do you reload nginx after adding or changing a site config file?
Run
sudo nginx -t to test the config, then sudo systemctl reload nginx to apply changes without downtime.Click to reveal answer
intermediate
What is the purpose of the
include directive in nginx main config for separate site files?It tells nginx to load all site config files from a directory, usually
include /etc/nginx/sites-enabled/*;, so each site config is read automatically.Click to reveal answer
Where should you place individual site config files in nginx?
✗ Incorrect
Site config files are placed in /etc/nginx/sites-available/ for organization and management.
How do you enable a site config in nginx after creating it in sites-available?
✗ Incorrect
Creating a symbolic link in sites-enabled activates the site config.
What command checks nginx config syntax before reloading?
✗ Incorrect
The command nginx -t tests the configuration syntax.
What does the include directive do in nginx config?
✗ Incorrect
The include directive loads other config files into nginx's main configuration.
Why is it better to use separate config files per site?
✗ Incorrect
Separate files help keep site configs organized and easy to manage.
Explain how to set up nginx to serve multiple websites using separate config files.
Think about file locations, linking, and commands to reload.
You got /5 concepts.
Describe the benefits of using separate config files per site in nginx.
Consider how managing many sites is easier this way.
You got /5 concepts.