---
title: "Nginx: Web Server Fundamentals"
description: "Test your knowledge of Nginx configuration, reverse proxying, load balancing, and SSL/TLS termination."
author: "Mohammad Abu Mattar"
canonical: https://mkabumattar.com/quizzes/post/nginx-web-server-fundamentals-quiz
---

# Nginx: Web Server Fundamentals

Welcome to the Nginx Basics Quiz! Nginx is the Swiss Army knife of modern web infrastructure. Whether you are serving a simple static site, managing traffic for a massive cluster of microservices, or securing your apps with SSL, Nginx is likely at the center of your architecture. This quiz will test your ability to read, write, and troubleshoot Nginx configurations. Let's get started!

## Questions

### 1. What is the primary role of a "Reverse Proxy"?

- To encrypt client traffic for anonymous internet browsing
- To accept requests for a backend server and return the results
- To increase the physical clock speed of the server hardware
- To store and index site content in a relational database

**Hint:** Think about who the client is talking to.

### 2. Which configuration block is used to define a virtual host in Nginx?

- The http {} block
- The server {} block
- The location {} block
- The upstream {} block

**Hint:** It defines the domain and port.

### 3. What does the "proxy_pass" directive do?

- It manages user authentication and password validation
- It maps a URL path to a backend server or upstream group
- It automates the rotation and deletion of old log files
- It performs full disk encryption for the web server files

**Hint:** Sending the request forward.

### 4. Which load balancing algorithm is the default in Nginx?

- Least Connections
- Round Robin
- IP Hash
- Weighted Random

**Hint:** One after another.

### 5. What is the purpose of the "upstream" block?

- To configure the external ISP network gateway
- To define a pool of backend servers for load balancing
- To facilitate the upload of large binary files to the cloud
- To restart the Nginx service after a configuration change

**Hint:** Grouping servers.

### 6. What does "SSL Termination" mean in the context of Nginx?

- Revoking an SSL certificate before its expiration date
- Decrypting HTTPS traffic and sending HTTP to the backend
- Removing private security keys from the physical server
- Blocking all incoming requests that use port 443

**Hint:** Decrypting at the gate.

### 7. Which Nginx directive specifies the port the server should listen on?

- The "port" directive
- The "listen" directive
- The "connect" directive
- The "open" directive

**Hint:** Standard networking term.

### 8. In Nginx, what does the "root" directive define?

- The administrative password for the server root user
- The directory on disk where static web files are located
- The highest level of the Nginx configuration hierarchy
- A command used to re-initialize the server process

**Hint:** Where the files live.

### 9. What is the difference between "root" and "alias" in Nginx?

- There is no functional difference between the two
- "root" appends the URI to the path; "alias" replaces it
- "alias" is used exclusively for serving image files
- "root" provides a significant performance boost over alias

**Hint:** How the path is appended.

### 10. Which Nginx command is used to test the configuration for errors?

- `nginx -v`
- `nginx -t`
- `nginx -s reload`
- `nginx -check`

**Hint:** Test flag.

### 11. What is the purpose of the "worker_processes" directive?

- To limit the maximum number of concurrent guest users
- To define the number of Nginx processes currently running
- To schedule the specific times that the server is active
- To limit the number of developers allowed to edit the file

**Hint:** Scalability and CPU cores.

### 12. Which directive is used to redirect HTTP traffic to HTTPS?

- The "move" directive
- return 301 https://$host$request_uri;
- The "proxy_set_header" directive
- The "listen 443" directive

**Hint:** Changing the response code.

### 13. What does the "worker_connections" directive define?

- The number of physical Ethernet cables in the server
- The maximum simultaneous connections per worker process
- The number of administrative users allowed to connect
- The maximum bandwidth speed allowed for the network

**Hint:** Max load per process.

### 14. Where is the main Nginx configuration file usually located on Linux?

- /var/www/html/nginx.conf
- /etc/nginx/nginx.conf
- /home/user/nginx.conf
- /bin/nginx.conf

**Hint:** Standard /etc path.

### 15. What is the purpose of "gzip" in Nginx?

- To provide end-to-end encryption for all web traffic
- To compress files before transmission to save bandwidth
- To create a backup archive of the entire website
- To delete outdated and temporary files from the disk

**Hint:** Compressing data.

### 16. What does the "location /" block match?

- Only requests for the site homepage
- Any request not matched by a more specific block
- Only static files located in the root directory
- No requests, as it is a reserved error block

**Hint:** The base path.

### 17. Which directive is used to set a custom 404 error page?

- The "404_page" directive
- error_page 404 /custom_404.html;
- The "missing_file_redirect" directive
- The "fail_timeout" directive

**Hint:** Handling errors.

### 18. What is the "try_files" directive commonly used for?

- To attempt to repair corrupted configuration files
- To check for file existence and fall back to a default
- To upload multiple files to an external storage service
- To remove unused or temporary files from the server

**Hint:** Single Page Apps (SPAs).

### 19. What is "Nginx FastCGI" used for?

- To optimize the delivery speed of the global internet
- To interface Nginx with a dynamic language processor
- To accelerate the download of large software packages
- To provide encryption for the backend database

**Hint:** Connecting to PHP.

### 20. In load balancing, what does "weight" do?

- It measures the physical mass of the server hardware
- It assigns more traffic to servers with a higher value
- It sets the maximum body size for client file uploads
- It limits the data transfer speed of the network

**Hint:** Favoring certain servers.

### 21. What is the purpose of "proxy_set_header Host $host;"?

- To rename the server on the internal network
- To pass the original requested domain to the backend
- To hide the public IP address of the end user
- To encrypt the metadata within the HTTP headers

**Hint:** Preserving the domain name.

### 22. What does the "include" directive do in Nginx?

- It adds a new user to the global Nginx mailing list
- It pulls in configuration settings from an external file
- It adds a new physical node to the load balancer cluster
- It injects custom CSS directly into the served HTML files

**Hint:** Modular configuration.

### 23. What is an Nginx "Module"?

- A spare hardware component for the physical server
- A plugin that adds specific features to the server
- A specialized type of lightweight virtual machine
- A utility used to rotate and compress system logs

**Hint:** Extended functionality.

### 24. What is the "client_max_body_size" directive used for?

- To limit the physical dimensions of the server rack
- To set the maximum allowed size of a client request
- To restrict the total number of users on the site
- To regulate the global internet speed for all clients

**Hint:** Large file uploads.

### 25. What does "Stub Status" provide in Nginx?

- A list of broken internal links on the website
- A page displaying basic performance and connection metrics
- A utility for deleting old and unused configuration files
- A registry containing all registered user accounts

**Hint:** Basic metrics.

### 26. What is the "keepalive_timeout" directive?

- The time before an inactive server is deleted
- The time a connection stays open after a request
- The maximum duration allowed for a developer to edit
- The physical speed of the local area network

**Hint:** Closing idle connections.

### 27. What is the purpose of "X-Forwarded-For" header?

- To send an automated response to an external email
- To identify the original IP address of the client
- To provide a secure hash of the user password
- To increase the caching speed of the web server

**Hint:** Identifying the real user.

### 28. In Nginx, what does the "events {}" block contain?

- A calendar list of all scheduled site maintenance
- Directives that manage the processing of connections
- A historical log of all previous system crashes
- A programming tool for writing and debugging HCL code

**Hint:** Core process settings.

### 29. What is "HSTS" (HTTP Strict Transport Security)?

- A method for increasing the physical server throughput
- A header that forces the browser to only use HTTPS
- A cleanup utility for deleting old SSL certificates
- A list of all users currently connected to the site

**Hint:** Forcing HTTPS in the browser.

### 30. Which command reloads the Nginx configuration without stopping the service?

- `nginx stop`
- `nginx -s reload`
- `nginx -restart`
- `nginx -clean`

**Hint:** Zero-downtime update.
