Complete the code to set the server name to example.com.
server_name [1];The server_name directive specifies the domain name that the server block responds to. Here, example.com is the correct domain.
Complete the code to set the server to respond to both www.example.com and example.com.
server_name [1];The server_name directive can list multiple names separated by spaces. This allows the server to respond to both example.com and www.example.com.
Fix the error in the server_name directive to correctly match all subdomains of example.com.
server_name [1];Using *.example.com matches all subdomains of example.com, like blog.example.com or shop.example.com.
Fill both blanks to set the server to respond to example.com and redirect www.example.com to it.
server_name [1]; if ($host = [2]) { return 301 https://example.com$request_uri; }
The server listens to example.com. The if condition checks if the host is www.example.com and redirects it to example.com.
Fill all three blanks to create a server block that listens on port 80, sets server_name to example.com and www.example.com, and redirects all HTTP requests to HTTPS.
server {
listen [1];
server_name [2];
return [3] https://$host$request_uri;
}The server listens on port 80 (HTTP). It responds to both example.com and www.example.com. The return 301 redirects all requests to HTTPS.