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

What are the nginx start and stop commands?

下次还敢
下次还敢Original
2024-04-02 20:45:15803browse

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

What are the nginx start and stop commands?

Nginx 的启动和停止命令

启动命令:

nginx

停止命令:

nginx -s quit

详细说明:

启动命令:

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

停止命令:

  • 使用 nginx -s quit 安全地停止 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!

Statement:
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
Previous article:What is the use of nginx load balancing?Next article:None