Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to listen on HTTP port 80.
Nginx
server {
listen [1];
server_name example.com;
} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using port 443 instead of 80 for HTTP.
Using an unrelated port like 22.
✗ Incorrect
Port 80 is the default port for HTTP traffic.
2fill in blank
mediumComplete the code to redirect all HTTP requests to HTTPS.
Nginx
server {
listen 80;
server_name example.com;
return [1] https://$host$request_uri;
} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 404 which means not found.
Using 200 which means OK, no redirect.
✗ Incorrect
301 is the status code for permanent redirect, used to send HTTP to HTTPS.
3fill in blank
hardFix the error in the HTTPS server block to enable SSL.
Nginx
server {
listen 443 ssl;
server_name example.com;
ssl_certificate [1];
ssl_certificate_key /etc/ssl/private/example.key;
} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using the key file path for ssl_certificate.
Using unrelated file paths.
✗ Incorrect
The ssl_certificate directive must point to the SSL certificate file, usually a .crt file.
4fill in blank
hardFill both blanks to complete the HTTPS server block with root and index directives.
Nginx
server {
listen 443 ssl;
server_name example.com;
root [1];
index [2];
} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a file path for root.
Using a folder path for index.
✗ Incorrect
The root directive sets the folder for website files, and index sets the default file to serve.
5fill in blank
hardFill all three blanks to complete a secure HTTPS server block with SSL protocols and ciphers.
Nginx
server {
listen 443 ssl;
server_name example.com;
ssl_protocols [1];
ssl_ciphers [2];
ssl_prefer_server_ciphers [3];
} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using outdated protocols like SSLv3.
Turning off server cipher preference.
✗ Incorrect
These settings enable modern TLS versions, strong ciphers, and prefer server cipher order for security.