docs/man/nginx.8 - nginx-1.31.7 nginx/ @ 939334eff

Data types defined

Source code

  1. .\"
  2. .\" Copyright (C) 2010, 2019 Sergey A. Osokin
  3. .\" Copyright (C) Nginx, Inc.
  4. .\" All rights reserved.
  5. .\"
  6. .\" Redistribution and use in source and binary forms, with or without
  7. .\" modification, are permitted provided that the following conditions
  8. .\" are met:
  9. .\" 1. Redistributions of source code must retain the above copyright
  10. .\"    notice, this list of conditions and the following disclaimer.
  11. .\" 2. Redistributions in binary form must reproduce the above copyright
  12. .\"    notice, this list of conditions and the following disclaimer in the
  13. .\"    documentation and/or other materials provided with the distribution.
  14. .\"
  15. .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  16. .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  17. .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  18. .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  19. .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  20. .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  21. .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  22. .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  23. .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  24. .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  25. .\" SUCH DAMAGE.
  26. .\"
  27. .\"
  28. .Dd September 4, 2026
  29. .Dt NGINX 8
  30. .Os
  31. ‌.Sh NAME
  32. .Nm nginx
  33. .Nd "HTTP and reverse proxy server, mail proxy server"
  34. ‌.Sh SYNOPSIS
  35. .Nm
  36. .Op Fl ?hqTtVv
  37. .Op Fl c Ar file
  38. .Op Fl e Ar file
  39. .Op Fl g Ar directives
  40. .Op Fl l Ar address
  41. .Op Fl p Ar prefix
  42. .Op Fl s Ar signal
  43. ‌.Sh DESCRIPTION
  44. .Nm
  45. (pronounced
  46. .Dq engine x )
  47. is an HTTP and reverse proxy server, a mail proxy server, and a generic
  48. TCP/UDP proxy server.
  49. It is known for its high performance, stability, rich feature set, simple
  50. configuration, and low resource consumption.
  51. .Pp
  52. The options are as follows:
  53. .Bl -tag -width ".Fl d Ar directives"
  54. .It Fl ?\& , h
  55. Print help.
  56. .It Fl c Ar file
  57. Use an alternative configuration
  58. .Ar file .
  59. .It Fl e Ar file
  60. Use an alternative error log
  61. .Ar file .
  62. Special value
  63. .Cm stderr
  64. indicates that the standard error output should be used.
  65. .It Fl g Ar directives
  66. Set global configuration directives.
  67. See
  68. .Sx EXAMPLES
  69. for details.
  70. .It Fl l Ar address
  71. Set a control socket listen address.
  72. See
  73. .Sx CONTROL SOCKET
  74. for details.
  75. .It Fl p Ar prefix
  76. Set the prefix path.
  77. The default value is
  78. .Pa %%PREFIX%% .
  79. .It Fl q
  80. Suppress non-error messages during configuration testing.
  81. .It Fl s Ar signal
  82. Send a signal to the master process.
  83. The argument
  84. .Ar signal
  85. can be one of:
  86. .Cm stop , quit , reopen , reload .
  87. The following table shows the corresponding system signals:
  88. .Pp
  89. .Bl -tag -width ".Cm reopen" -compact
  90. .It Cm stop
  91. .Dv SIGTERM
  92. .It Cm quit
  93. .Dv SIGQUIT
  94. .It Cm reopen
  95. .Dv SIGUSR1
  96. .It Cm reload
  97. .Dv SIGHUP
  98. .El
  99. .It Fl T
  100. Same as
  101. .Fl t ,
  102. but additionally dump configuration files to standard output.
  103. .It Fl t
  104. Do not run, just test the configuration file.
  105. .Nm
  106. checks the configuration file syntax and then tries to open files
  107. referenced in the configuration file, including binding to configured
  108. listen addresses.
  109. .It Fl V
  110. Print the
  111. .Nm
  112. version, compiler version, and
  113. .Pa configure
  114. script parameters.
  115. .It Fl v
  116. Print the
  117. .Nm
  118. version.
  119. .El
  120. ‌.Sh SIGNALS
  121. The master process of
  122. .Nm
  123. can handle the following signals:
  124. .Pp
  125. .Bl -tag -width ".Dv SIGINT , SIGTERM" -compact
  126. .It Dv SIGINT , SIGTERM
  127. Shut down quickly.
  128. .It Dv SIGHUP
  129. Reload configuration, start the new worker process with a new
  130. configuration, and gracefully shut down old worker processes.
  131. .It Dv SIGQUIT
  132. Shut down gracefully.
  133. .It Dv SIGUSR1
  134. Reopen log files.
  135. .It Dv SIGUSR2
  136. Upgrade the
  137. .Nm
  138. executable on the fly.
  139. .It Dv SIGWINCH
  140. Shut down worker processes gracefully.
  141. .El
  142. .Pp
  143. While there is no need to explicitly control worker processes normally,
  144. they support some signals too:
  145. .Pp
  146. .Bl -tag -width ".Dv SIGINT , SIGTERM" -compact
  147. .It Dv SIGTERM
  148. Shut down quickly.
  149. .It Dv SIGQUIT
  150. Shut down gracefully.
  151. .It Dv SIGUSR1
  152. Reopen log files.
  153. .El
  154. ‌.Sh DEBUGGING LOG
  155. To enable a debugging log, reconfigure
  156. .Nm
  157. to build with debugging:
  158. .Pp
  159. .Dl "./configure --with-debug ..."
  160. .Pp
  161. and then set the
  162. .Cm debug
  163. level of the
  164. .Va error_log :
  165. .Pp
  166. .Dl "error_log /path/to/log debug;"
  167. .Pp
  168. It is also possible to enable the debugging for a particular IP address:
  169. .Bd -literal -offset indent
  170. events {
  171.     debug_connection 127.0.0.1;
  172. }
  173. .Ed
  174. ‌.Sh CONTROL SOCKET
  175. To enable a control socket, reconfigure
  176. .Nm
  177. to build with control API:
  178. .Pp
  179. .Dl "./configure --with-control-api ..."
  180. .Pp
  181. and then set the control socket listen address, for example:
  182. .Bd -literal -offset indent
  183. nginx -c ~/mynginx.conf -l 127.0.0.1:8888
  184. .Ed
  185. .Pp
  186. IPv6 addresses should be enclosed in square brackets:
  187. .Bd -literal -offset indent
  188. nginx -c ~/mynginx.conf -l [::1]:8888
  189. .Ed
  190. .Pp
  191. It is also possible to set a UNIX-domain socket:
  192. .Bd -literal -offset indent
  193. nginx -c ~/mynginx.conf -l unix:/path/to/socket
  194. .Ed
  195. ‌.Sh ENVIRONMENT
  196. The
  197. .Ev NGINX
  198. environment variable is used internally by
  199. .Nm
  200. and should not be set directly by the user.
  201. ‌.Sh FILES
  202. .Bl -tag -width indent
  203. .It Pa %%PID_PATH%%
  204. Contains the process ID of
  205. .Nm .
  206. The contents of this file are not sensitive, so it can be world-readable.
  207. .It Pa %%CONF_PATH%%
  208. The main configuration file.
  209. .It Pa %%ERROR_LOG_PATH%%
  210. Error log file.
  211. .El
  212. ‌.Sh EXIT STATUS
  213. Exit status is 0 on success, or 1 if the command fails.
  214. ‌.Sh EXAMPLES
  215. Test configuration file
  216. .Pa ~/mynginx.conf
  217. with global directives for PID and quantity of worker processes:
  218. .Bd -literal -offset indent
  219. nginx -t -c ~/mynginx.conf \e
  220.     -g "pid /var/run/mynginx.pid; worker_processes 2;"
  221. .Ed
  222. ‌.Sh SEE ALSO
  223. .\"Xr nginx.conf 5
  224. .\"Pp
  225. Documentation at
  226. .Pa http://nginx.org/en/docs/ .
  227. ‌.Sh HISTORY
  228. Development of
  229. .Nm
  230. started in 2002, with the first public release on October 4, 2004.
  231. ‌.Sh AUTHORS
  232. .An -nosplit
  233. .An Igor Sysoev Aq Mt igor@sysoev.ru .
  234. .Pp
  235. This manual page was originally written by
  236. .An Sergey A. Osokin Aq Mt osa@FreeBSD.org.ru
  237. as a result of compiling many
  238. .Nm
  239. documents from all over the world.