Master Nginx Configuration Essentials with 120 free flashcards. Study using spaced repetition and focus mode for effective learning in Devops.
Sample card
What does nginx stand for?
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.
nginx -s stop and nginx -s quit?
Q · 1 of 120
What does nginx stand for?
Q · 2 of 120
What is nginx's primary process model?
Q · 3 of 120
How do you reload nginx configuration without dropping connections?
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.
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.
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.
nginx -s stop and nginx -s quit?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.
nginx -t (or nginx -T to additionally dump the parsed configuration to stdout). Useful in CI/CD pipelines before a reload.
/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/.
include /path/to/file.conf; Glob patterns are supported, e.g. include /etc/nginx/conf.d/*.conf;.
http {} (HTTP server settings) and server {} (virtual host). Inside them live location {}, upstream {}, events {}, and the top-level main context.
worker_processes directive control?The number of worker processes the master spawns. The conventional setting is worker_processes auto;, which detects the number of CPU cores.
worker_connections?A practical starting point is worker_connections 1024; (or higher, e.g. 4096/8192) inside the events {} block. Max clients ≈ worker_processes × worker_connections.
sendfile(2) for static file delivery?sendfile on; inside http {} or server {}. It lets nginx use the kernel zero-copy path, dramatically speeding up static transfers.
tcp_nopush do?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;.
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