docs/man/nginx.8 - nginx

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 January 21, 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 p Ar prefix
  41. .Op Fl s Ar signal
  42. .Sh DESCRIPTION
  43. .Nm
  44. (pronounced
  45. .Dq engine x )
  46. is an HTTP and reverse proxy server, a mail proxy server, and a generic
  47. TCP/UDP proxy server.
  48. It is known for its high performance, stability, rich feature set, simple
  49. configuration, and low resource consumption.
  50. .Pp
  51. The options are as follows:
  52. .Bl -tag -width ".Fl d Ar directives"
  53. .It Fl ?\& , h
  54. Print help.
  55. .It Fl c Ar file
  56. Use an alternative configuration
  57. .Ar file .
  58. .It Fl e Ar file
  59. Use an alternative error log
  60. .Ar file .
  61. Special value
  62. .Cm stderr
  63. indicates that the standard error output should be used.
  64. .It Fl g Ar directives
  65. Set global configuration directives.
  66. See
  67. .Sx EXAMPLES
  68. for details.
  69. .It Fl p Ar prefix
  70. Set the prefix path.
  71. The default value is
  72. .Pa %%PREFIX%% .
  73. .It Fl q
  74. Suppress non-error messages during configuration testing.
  75. .It Fl s Ar signal
  76. Send a signal to the master process.
  77. The argument
  78. .Ar signal
  79. can be one of:
  80. .Cm stop , quit , reopen , reload .
  81. The following table shows the corresponding system signals:
  82. .Pp
  83. .Bl -tag -width ".Cm reopen" -compact
  84. .It Cm stop
  85. .Dv SIGTERM
  86. .It Cm quit
  87. .Dv SIGQUIT
  88. .It Cm reopen
  89. .Dv SIGUSR1
  90. .It Cm reload
  91. .Dv SIGHUP
  92. .El
  93. .It Fl T
  94. Same as
  95. .Fl t ,
  96. but additionally dump configuration files to standard output.
  97. .It Fl t
  98. Do not run, just test the configuration file.
  99. .Nm
  100. checks the configuration file syntax and then tries to open files
  101. referenced in the configuration file, including binding to configured
  102. listen addresses.
  103. .It Fl V
  104. Print the
  105. .Nm
  106. version, compiler version, and
  107. .Pa configure
  108. script parameters.
  109. .It Fl v
  110. Print the
  111. .Nm
  112. version.
  113. .El
  114. .Sh SIGNALS
  115. The master process of
  116. .Nm
  117. can handle the following signals:
  118. .Pp
  119. .Bl -tag -width ".Dv SIGINT , SIGTERM" -compact
  120. .It Dv SIGINT , SIGTERM
  121. Shut down quickly.
  122. .It Dv SIGHUP
  123. Reload configuration, start the new worker process with a new
  124. configuration, and gracefully shut down old worker processes.
  125. .It Dv SIGQUIT
  126. Shut down gracefully.
  127. .It Dv SIGUSR1
  128. Reopen log files.
  129. .It Dv SIGUSR2
  130. Upgrade the
  131. .Nm
  132. executable on the fly.
  133. .It Dv SIGWINCH
  134. Shut down worker processes gracefully.
  135. .El
  136. .Pp
  137. While there is no need to explicitly control worker processes normally,
  138. they support some signals too:
  139. .Pp
  140. .Bl -tag -width ".Dv SIGINT , SIGTERM" -compact
  141. .It Dv SIGTERM
  142. Shut down quickly.
  143. .It Dv SIGQUIT
  144. Shut down gracefully.
  145. .It Dv SIGUSR1
  146. Reopen log files.
  147. .El
  148. .Sh DEBUGGING LOG
  149. To enable a debugging log, reconfigure
  150. .Nm
  151. to build with debugging:
  152. .Pp
  153. .Dl "./configure --with-debug ..."
  154. .Pp
  155. and then set the
  156. .Cm debug
  157. level of the
  158. .Va error_log :
  159. .Pp
  160. .Dl "error_log /path/to/log debug;"
  161. .Pp
  162. It is also possible to enable the debugging for a particular IP address:
  163. .Bd -literal -offset indent
  164. events {
  165.     debug_connection 127.0.0.1;
  166. }
  167. .Ed
  168. .Sh ENVIRONMENT
  169. The
  170. .Ev NGINX
  171. environment variable is used internally by
  172. .Nm
  173. and should not be set directly by the user.
  174. .Sh FILES
  175. .Bl -tag -width indent
  176. .It Pa %%PID_PATH%%
  177. Contains the process ID of
  178. .Nm .
  179. The contents of this file are not sensitive, so it can be world-readable.
  180. .It Pa %%CONF_PATH%%
  181. The main configuration file.
  182. .It Pa %%ERROR_LOG_PATH%%
  183. Error log file.
  184. .El
  185. .Sh EXIT STATUS
  186. Exit status is 0 on success, or 1 if the command fails.
  187. .Sh EXAMPLES
  188. Test configuration file
  189. .Pa ~/mynginx.conf
  190. with global directives for PID and quantity of worker processes:
  191. .Bd -literal -offset indent
  192. nginx -t -c ~/mynginx.conf \e
  193.     -g "pid /var/run/mynginx.pid; worker_processes 2;"
  194. .Ed
  195. .Sh SEE ALSO
  196. .\"Xr nginx.conf 5
  197. .\"Pp
  198. Documentation at
  199. .Pa http://nginx.org/en/docs/ .
  200. .Pp
  201. For questions and technical support, please refer to
  202. .Pa http://nginx.org/en/support.html .
  203. .Sh HISTORY
  204. Development of
  205. .Nm
  206. started in 2002, with the first public release on October 4, 2004.
  207. .Sh AUTHORS
  208. .An -nosplit
  209. .An Igor Sysoev Aq Mt igor@sysoev.ru .
  210. .Pp
  211. This manual page was originally written by
  212. .An Sergey A. Osokin Aq Mt osa@FreeBSD.org.ru
  213. as a result of compiling many
  214. .Nm
  215. documents from all over the world.