Complete the code to set the server listening port to 8080.
server {
listen [1];
}The listen directive sets the port the server listens on. Here, 8080 is the correct port.
Complete the code to define the root directory for the server.
server {
root [1];
}The root directive sets the directory where the server looks for files. /var/www/html is the common web root.
Fix the error in the location block to serve static files from /static.
server {
location /static/ [1]
root /var/www/html;
}
}Blocks in nginx configuration use curly braces { }. The location block must start with {.
Complete the code to create a server block that listens on port 80 and serves files from /usr/share/nginx/html.
server {
listen [1];
root /usr/share/nginx/html;
}The server block starts with a curly brace { and the listen directive should be set to port 80 for HTTP.
Complete the code to create a location block that matches /images/, uses alias to /data/images, and closes the block properly.
location /images/ {
alias [1];
}The location block starts with {, uses the alias directive to point to the directory, and ends with }.