Home >Operation and Maintenance >Nginx >How to restart Nginx

How to restart Nginx

青灯夜游
青灯夜游Original
2019-06-06 18:44:40107682browse

How to restart Nginx

Steps to restart nginx:

##1. Verify that the nginx configuration file is correct

Method 1: Enter the nginx installation directory sbin, enter the command ./nginx -t

and see the following display:

nginx.conf syntax is oknginx .conf test is successful

It means the configuration file is correct!

How to restart Nginx

Method 2: Add -t before the startup command -c


How to restart Nginx

2, Restart the Nginx service

Method 1: Enter the nginx executable directory sbin and enter the command

./nginx -s reload, then

How to restart Nginx

Method 2: Find the current nginx process number, and then enter the command:

kill -HUP process number to restart the nginx service

How to restart Nginx

The above is the detailed content of How to restart Nginx. 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:How to read nginx logsNext article:How to read nginx logs