Home > Operation and Maintenance > Nginx > What are the nginx start and stop commands?

What are the nginx start and stop commands?

下次还敢
Release: 2024-04-02 20:45:15
Original
1307 people have browsed it

Nginx 的启动和停止命令分别为 nginx 和 nginx -s quit。启动命令直接启动服务器,而停止命令优雅地关闭服务器,允许所有当前请求处理完毕。其他可用停止信号包括 stop 和 reload。

What are the nginx start and stop commands?

Nginx 的启动和停止命令

启动命令:

<code>nginx</code>
Copy after login

停止命令:

<code>nginx -s quit</code>
Copy after login

详细说明:

启动命令:

  • 只需使用 <code>nginx</code> 命令即可启动 Nginx 服务器。
  • 该命令将加载配置文件并启动监听端口。
  • 如果没有指定配置文件位置,将使用默认配置文件 /etc/nginx/nginx.conf

停止命令:

  • 使用 <code>nginx -s quit</code> 安全地停止 Nginx 服务器。
  • -s 选项指定向 Nginx 进程发送的信号。
  • quit 信号会优雅地关闭服务器,允许所有当前请求处理完毕。
  • 其他可用信号包括:

    • stop: 停止服务器,关闭所有监听端口但不会关闭已建立的连接。
    • reload: 重新加载配置文件,保留现有连接。

The above is the detailed content of What are the nginx start and stop commands?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template