Complete the code to set the root directory for the server.
server {
listen 80;
[1] /var/www/html;
}The root directive sets the root directory for requests.
Complete the code to set the root directory inside a location block.
server {
listen 80;
location /images/ {
[1] /data/images;
}
}The root directive inside a location block sets the root directory for that location.
Fix the error in the root directive syntax.
server {
listen 80;
root [1] /var/www/html;
}The root directive should be followed by the path and then a semicolon. No extra token is needed between 'root' and the path.
Fill both blanks to create a location block that serves files from /usr/share/nginx/html for the root URL.
server {
listen 80;
location [1] {
[2] /usr/share/nginx/html;
}
}The location '/' matches the root URL, and the root directive sets the directory to serve files from.
Fill all three blanks to create a server block that listens on port 8080, serves files from /var/www/site, and sets the index file to index.html.
server {
listen [1];
root [2];
index [3];
}The server listens on port 8080, serves files from /var/www/site, and uses index.html as the default index file.