Smooth restart
If the Nginx server is running and the module needs to be upgraded, added, or deleted, we need to stop the server and modify it accordingly, so that the server will stop service for a period of time, nginx can be upgraded without stopping services.
Smooth restart command:
Kill-HUP enters the title or process number file path
Or use
/Usr/nginx/sbin/nginx-s reload
Note: after modifying the configuration file, check whether the modified configuration file is correct to avoid Nginx errors affecting the stable running of the server. The command to determine whether the Nginx configuration is correct is as follows:
Nginx-t-c/usr/nginx/conf/nginx. conf
Or
/Usr/nginx/sbin/nginx-t
Nginx reload restart
Run
#/Usr/local/nginx/sbin/nginx-s reload
Nginx has been restarted successfully
Restart with root permission
# Killall nginx
# Nginx
Linux restart
Sudo/etc/init. d/nginx Usage:
/Etc/init. d/nginx {start | stop | status | restart | condrestart | try-restart | reload | force-reload | configtest}
(Windows nginx)
@ Echo off
Role of rem current bat
Echo ============================ begin ============================= ====
Cls
SET NGINX_PATH = D:
SET NGINX_DIR = D: \ nginx \
Color 0a
TITLE Nginx hypervisor www.111cn.net control panel
CLS
ECHO.
ECHO. * Nginx hypervisor *
ECHO. * create 2013-10-15 *
ECHO.
: MENU
ECHO. * nginx process list *
Tasklist | findstr/I "nginx.exe"
ECHO.
ECHO. [1] start Nginx
ECHO. [2] disable Nginx
ECHO. [3] restart Nginx
ECHO. [4] return
ECHO.
ECHO. Enter the serial number of the selected project:
Set/p ID =
IF "% id %" = "1" GOTO start
IF "% id %" = "2" GOTO stop
IF "% id %" = "3" GOTO restart
IF "% id %" = "4" EXIT
PAUSE
: Start
Call: startNginx
GOTO MENU
: Stop
Call: shutdownNginx
GOTO MENU
: Restart
Call: shutdownNginx
Call: startNginx
GOTO MENU
: ShutdownNginx
ECHO.
ECHO. Disable Nginx ......
Taskkill/F/IM nginx.exe> nul
ECHO. OK, close all nginx processes
Goto: eof
: StartNginx
ECHO.
ECHO. Start Nginx ......
If not exist "%nginx_dir1_nginx.exe" ECHO "%nginx_dir1_nginx.exe" does NOT EXIST
% NGINX_PATH %
Cd "% NGINX_DIR %"
If exist "%nginx_dir1_nginx.exe "(
Echo "start ''nginx.exe"
Start "" nginx.exe
)
ECHO. OK
Goto: eof
Centos nginx restart
Restart Nginx
Service nginx restart
/Etc/init. d/nginx stop
/Etc/init. d/nginx start
Ubuntu Nginx
$ Sudo service nginx start
$ Sudo service nginx stop
Well, I have summarized the methods for restarting the nginx system in almost all systems. Each system may be slightly different. If you are interested, please refer to them.