通過控制台進入nginx目錄后
1. 啟動nginx
start nginx 或
nginx.exe
2. 重啟nginx
nginx -s reload
3. 停止nginx
nginx -s stop 或
nginx -s quit
stop是快速停止nginx,可能並不保存相關信息;quit是完整有序的停止nginx,並保存相關信息。
nginx命令行參數說明NginxCommandLine
Usage: nginx [-?hvVtq] [-s signal] [-c filename] [-p prefix] [-g directives]
- 1
Options | 說明 |
---|---|
-?,-h | Print help. |
-v | Print version. |
-V | Print nginx version, compiler version and configure parameters. |
-t | Don’t run, just test the configuration file. |
-q | suppress non-error messages during configuration testing |
-s signal | Send signal to a master process: stop, quit, reopen, reload. |
-p prefix | Set prefix path (default: /usr/local/nginx/) |
-c configPath | Specify which configuration file Nginx should use instead of the default. |
-g directives | Set global directives. |