Skip to content

Nginx Configuration Essentials

Master Nginx Configuration Essentials with 120 free flashcards. Study using spaced repetition and focus mode for effective learning in Devops.

🎓 120 cards ⏱️ ~60 min Advanced
Study Full Deck →
Share: 𝕏 Twitter LinkedIn WhatsApp

🎯 What You'll Learn

Preview Questions

12 shown

What does nginx stand for?

Show ▼

engine x — a high-performance open-source HTTP server, reverse proxy, and IMAP/POP3 mail proxy originally written by Igor Sysoev and first released in 2004.

What is nginx's primary process model?

Show ▼

A single master process that reads configuration, manages sockets, and spawns worker processes (default count = CPU cores). Workers handle all incoming connections using an event-driven, non-blocking loop.

How do you reload nginx configuration without dropping connections?

Show ▼

Send SIGHUP to the master process (or run nginx -s reload). The master re-reads config, spawns new workers with the new config, and gracefully shuts down old workers after their connections drain.

What is the difference between <code>nginx -s stop</code> and <code>nginx -s quit</code>?

Show ▼

stop sends SIGTERM to workers and forces them to exit immediately, closing open connections. quit sends SIGQUIT, which lets workers finish serving current requests before exiting.

What command tests configuration syntax without applying it?

Show ▼

nginx -t (or nginx -T to additionally dump the parsed configuration to stdout). Useful in CI/CD pipelines before a reload.

Where is nginx's main configuration file by default on Linux?

Show ▼

/etc/nginx/nginx.conf. Additional files are typically included via include /etc/nginx/conf.d/*.conf; and per-site configs in /etc/nginx/sites-enabled/.

What directive tells nginx to include another configuration file?

Show ▼

include /path/to/file.conf; Glob patterns are supported, e.g. include /etc/nginx/conf.d/*.conf;.

What are the two main configuration contexts in nginx?

Show ▼

http {} (HTTP server settings) and server {} (virtual host). Inside them live location {}, upstream {}, events {}, and the top-level main context.

What does the <code>worker_processes</code> directive control?

Show ▼

The number of worker processes the master spawns. The conventional setting is worker_processes auto;, which detects the number of CPU cores.

What is the recommended value for <code>worker_connections</code>?

Show ▼

A practical starting point is worker_connections 1024; (or higher, e.g. 4096/8192) inside the events {} block. Max clients ≈ worker_processes × worker_connections.

Which directive enables <code>sendfile(2)</code> for static file delivery?

Show ▼

sendfile on; inside http {} or server {}. It lets nginx use the kernel zero-copy path, dramatically speeding up static transfers.

What does <code>tcp_nopush</code> do?

Show ▼

When enabled with sendfile, it instructs nginx to send response headers in one TCP packet (uses TCP_CORK). It is set with tcp_nopush on;.

🎓 Start studying Nginx Configuration Essentials

🎮 Study Modes Available

🔄

Flashcards

Flip to reveal

🧠

Focus Mode

Spaced repetition

Multiple Choice

Test your knowledge

⌨️

Type Answer

Active recall

📚

Learn Mode

Multi-round mastery

🎯

Match Game

Memory challenge

Related Topics in Devops

📖 Learning Resources