0
0
Nginxdevops~5 mins

HTTP/2 configuration in Nginx - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is HTTP/2 and why is it important in web servers like nginx?
HTTP/2 is a newer version of the HTTP protocol that makes websites load faster by allowing multiple requests at the same time over one connection. It improves speed and efficiency compared to HTTP/1.1.
Click to reveal answer
beginner
How do you enable HTTP/2 in an nginx server block?
Add the keyword http2 to the listen directive in your server block, for example: <br>listen 443 ssl http2;
Click to reveal answer
intermediate
Why must SSL/TLS be enabled to use HTTP/2 in nginx?
Most browsers require HTTP/2 to run over a secure connection (HTTPS). So nginx must have SSL/TLS configured to use HTTP/2.
Click to reveal answer
intermediate
What is the purpose of the ssl_certificate and ssl_certificate_key directives in nginx HTTP/2 configuration?
They specify the paths to your SSL certificate and private key files. These files enable encrypted connections needed for HTTP/2.
Click to reveal answer
beginner
How can you verify that HTTP/2 is working on your nginx server?
Use browser developer tools or online tools to check the protocol used. You can also run curl -I --http2 https://yourdomain.com to see if HTTP/2 is active.
Click to reveal answer
Which directive enables HTTP/2 in an nginx server block?
Ahttp2_enable on;
Benable_http2 true;
Clisten 443 ssl http2;
Dprotocol http2;
Why is SSL/TLS required for HTTP/2 in nginx?
ABecause browsers require HTTP/2 over secure connections
BBecause HTTP/2 only works on port 80
CBecause nginx does not support HTTP/2 without SSL
DBecause SSL/TLS speeds up HTTP/2
Which command can you use to check if your nginx server supports HTTP/2?
Anginx -t --http2
Bcurl -I --http2 https://yourdomain.com
Ccurl --http1.1 https://yourdomain.com
Dnginx -v http2
What files must be specified to enable SSL for HTTP/2 in nginx?
Assl_key and ssl_cert
Bhttp2_certificate and http2_key
Ctls_certificate and tls_key
Dssl_certificate and ssl_certificate_key
What is a main benefit of HTTP/2 over HTTP/1.1?
AAllows multiple requests over one connection
BUses less secure connections
CRequires more server memory
DOnly works with IPv6
Explain how to configure HTTP/2 in nginx including SSL setup.
Think about the server block and secure connection requirements.
You got /4 concepts.
    Describe how you can verify that HTTP/2 is active on your nginx server.
    Use simple command line tools or browser features.
    You got /3 concepts.