1NGINX(8) BSD System Manager's Manual NGINX(8)
2
4 nginx — HTTP and reverse proxy server, mail proxy server
5
7 nginx [-?hqTtVv] [-c file] [-e file] [-g directives] [-p prefix]
8 [-s signal]
9
11 nginx (pronounced “engine x”) is an HTTP and reverse proxy server, a mail
12 proxy server, and a generic TCP/UDP proxy server. It is known for its
13 high performance, stability, rich feature set, simple configuration, and
14 low resource consumption.
15
16 The options are as follows:
17
18 -?, -h Print help.
19
20 -c file Use an alternative configuration file.
21
22 -e file Use an alternative error log file. Special value stderr
23 indicates that the standard error output should be used.
24
25 -g directives Set global configuration directives. See EXAMPLES for de‐
26 tails.
27
28 -p prefix Set the prefix path. The default value is
29 /usr/share/nginx.
30
31 -q Suppress non-error messages during configuration testing.
32
33 -s signal Send a signal to the master process. The argument signal
34 can be one of: stop, quit, reopen, reload. The following
35 table shows the corresponding system signals:
36
37 stop SIGTERM
38 quit SIGQUIT
39 reopen SIGUSR1
40 reload SIGHUP
41
42 -T Same as -t, but additionally dump configuration files to
43 standard output.
44
45 -t Do not run, just test the configuration file. nginx
46 checks the configuration file syntax and then tries to
47 open files referenced in the configuration file.
48
49 -V Print the nginx version, compiler version, and configure
50 script parameters.
51
52 -v Print the nginx version.
53
55 The master process of nginx can handle the following signals:
56
57 SIGINT, SIGTERM Shut down quickly.
58 SIGHUP Reload configuration, start the new worker process with
59 a new configuration, and gracefully shut down old worker
60 processes.
61 SIGQUIT Shut down gracefully.
62 SIGUSR1 Reopen log files.
63 SIGUSR2 Upgrade the nginx executable on the fly.
64 SIGWINCH Shut down worker processes gracefully.
65
66 While there is no need to explicitly control worker processes normally,
67 they support some signals too:
68
69 SIGTERM Shut down quickly.
70 SIGQUIT Shut down gracefully.
71 SIGUSR1 Reopen log files.
72
74 To enable a debugging log, reconfigure nginx to build with debugging:
75
76 ./configure --with-debug ...
77
78 and then set the debug level of the error_log:
79
80 error_log /path/to/log debug;
81
82 It is also possible to enable the debugging for a particular IP address:
83
84 events {
85 debug_connection 127.0.0.1;
86 }
87
89 The NGINX environment variable is used internally by nginx and should not
90 be set directly by the user.
91
93 /run/nginx.pid
94 Contains the process ID of nginx. The contents of this file are
95 not sensitive, so it can be world-readable.
96
97 /etc/nginx/nginx.conf
98 The main configuration file.
99
100 /var/log/nginx/error.log
101 Error log file.
102
104 Exit status is 0 on success, or 1 if the command fails.
105
107 Test configuration file ~/mynginx.conf with global directives for PID and
108 quantity of worker processes:
109
110 nginx -t -c ~/mynginx.conf \
111 -g "pid /var/run/mynginx.pid; worker_processes 2;"
112
114 Documentation at http://nginx.org/en/docs/.
115
116 For questions and technical support, please refer to
117 http://nginx.org/en/support.html.
118
120 Development of nginx started in 2002, with the first public release on
121 October 4, 2004.
122
124 Igor Sysoev <igor@sysoev.ru>.
125
126 This manual page was originally written by Sergey A. Osokin
127 <osa@FreeBSD.org.ru> as a result of compiling many nginx documents from
128 all over the world.
129
130BSD November 5, 2020 BSD