0
0
Nginxdevops~5 mins

Separate config files per site in Nginx - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
A/etc/nginx/sites-available/
B/var/www/html/
C/usr/local/nginx/conf/
D/etc/nginx/conf.d/
How do you enable a site config in nginx after creating it in sites-available?
ACopy it to /etc/nginx/sites-enabled/
BEdit /etc/nginx/nginx.conf directly
CCreate a symbolic link in /etc/nginx/sites-enabled/
DRestart the server without changes
What command checks nginx config syntax before reloading?
Anginx -t
Bnginx -c
Cnginx -s reload
Dsystemctl status nginx
What does the include directive do in nginx config?
ACreates symbolic links
BStarts the nginx server
CDisables site configs
DIncludes external files into the main config
Why is it better to use separate config files per site?
ATo reduce server memory
BTo organize and manage sites easily
CTo speed up nginx startup
DTo avoid using symbolic links
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.