0
0
Nginxdevops~20 mins

Let's Encrypt with Certbot in Nginx - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Let's Encrypt Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
What is the output of the Certbot command for obtaining a certificate?
You run the command sudo certbot certonly --nginx -d example.com. What output indicates a successful certificate issuance?
A
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Error: Could not bind to port 80.
B
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Certificate request pending approval.
C
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator nginx, Installer None
Obtaining a new certificate
Successfully received certificate.
D
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Failed authorization procedure.
Attempts:
2 left
💡 Hint
Look for messages about successful certificate receipt.
Configuration
intermediate
2:00remaining
Which nginx server block configuration correctly enables HTTPS with Let's Encrypt certificate?
Given you have obtained certificates stored in /etc/letsencrypt/live/example.com/, which server block correctly configures nginx for HTTPS?
A
server {
    listen 443 ssl;
    server_name example.com;
    ssl_certificate /etc/letsencrypt/live/example.com/cert.pem;
    ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
    location / {
        root /var/www/html;
    }
}
B
server {
    listen 80 ssl;
    server_name example.com;
    ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
    location / {
        root /var/www/html;
    }
}
C
server {
    listen 443;
    server_name example.com;
    ssl_certificate /etc/letsencrypt/live/example.com/cert.pem;
    ssl_certificate_key /etc/letsencrypt/live/example.com/key.pem;
    location / {
        root /var/www/html;
    }
}
D
server {
    listen 443 ssl;
    server_name example.com;
    ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
    location / {
        root /var/www/html;
    }
}
Attempts:
2 left
💡 Hint
Check the listen directive and certificate file names.
Troubleshoot
advanced
2:00remaining
Why does Certbot fail with 'Could not bind to port 80' error?
You run sudo certbot certonly --standalone -d example.com but get an error about binding to port 80. What is the most likely cause?
AThe firewall is blocking outgoing connections from Certbot.
BAnother service like nginx is already using port 80, blocking Certbot's standalone server.
CThe domain name is not correctly pointed to your server's IP address.
DThe SSL certificate files are missing from /etc/letsencrypt/live.
Attempts:
2 left
💡 Hint
Port 80 must be free for Certbot standalone mode.
🔀 Workflow
advanced
2:00remaining
What is the correct renewal workflow for Let's Encrypt certificates with nginx and Certbot?
Which sequence correctly describes the steps to renew certificates automatically with Certbot and nginx?
A
1. Run <code>certbot renew</code> manually or via cron
2. Certbot renews certificates if near expiry
3. Reload nginx to apply renewed certificates
B
1. Stop nginx
2. Run <code>certbot certonly --standalone</code>
3. Start nginx
C
1. Delete old certificates
2. Run <code>certbot certonly --nginx</code>
3. Restart nginx
D
1. Run <code>certbot --nginx</code> every day
2. Reload nginx if certificates changed
Attempts:
2 left
💡 Hint
Renewal should be automated and nginx reloaded after renewal.
Best Practice
expert
3:00remaining
Which practice ensures secure and reliable automatic renewal of Let's Encrypt certificates with nginx?
Choose the best practice for automatic certificate renewal and nginx configuration to avoid downtime and security risks.
AUse Certbot's systemd timer for automatic renewal and configure nginx with a separate server block for HTTP to redirect to HTTPS.
BManually run Certbot renew weekly and restart nginx only if errors occur.
CDisable automatic renewal and renew certificates only when nginx shows SSL errors.
DUse Certbot standalone mode with nginx running and rely on manual reloads after renewal.
Attempts:
2 left
💡 Hint
Automation and proper nginx HTTP to HTTPS redirection improve security and uptime.