nginx
nginx is an open source HTTP server, originally created to solve the 10,000 concurrent connections problem.
Features
- HTTP server and proxy.
- Mail proxy for POP3 and IMAP.
- Generic TCP/UDP proxy.
Concepts
server {}
blocks represent individual virtual hosts, matched by alisten
address and optionalserver_name
s.- Modules provide non-core functionality, and can either by statically built into the
nginx
binary or loaded as dynamic modules withload_module
.
Signals
Signals can be sent either via the nginx -s
switch or by sending them to a running nginx master process.
Action | -s | POSIX signals |
---|---|---|
Fast shutdown | stop | TERM , INT |
Graceful shutdown (wait for workers to finish processing) | quit | QUIT |
Gracefully shutdown worker processes | N/A | WINCH |
Reload configuration | reload | HUP |
Reopen log files | reopen | USR1 |
On-the-fly executable upgrade | N/A | USR2 |
It's also possible to directly signal worker processes, though ordinarily the master would coordinate this.
Action | POSIX signals |
---|---|
Fast shutdown | TERM , INT |
Graceful shutdown | QUIT |
Reopen log files | USR1 |
Terminate abnormally for debugging | WINCH |
Configuration
Directive types
- Normal directives have one value per-context, and values specified deeper in a nested structure will take precedence.
- Array directives simply add a value to a set of values, leaving existing values in place.
- Action directives immediately perform an action, halting processing of other conditions and actions.
Scoping
http {}
server {}
location {}
Backlinks