nginx的安装windows

参考网站:nginx for Windows

1.下载https://nginx.org/en/download.html最新版本,nginx-1.25.3,解压到当前文件夹

 

2.启动,停止nginx

启动:

D:\nginx\nginx-1.25.3>start nginx.exe

查看nginx的启动进程:

D:\nginx\nginx-1.25.3>tasklist /fi "imagename eq nginx.exe"

映像名称                       PID 会话名              会话#       内存使用
========================= ======== ================ =========== ============
nginx.exe                    16944 Console                  111      8,224 K
nginx.exe                    38200 Console                  111      8,276 K

One of the processes is the master process and another is the worker process. If nginx does not start, 
look for the reason in the error log file logs\error.log. If the log file has not been created, the reason 
for this should be reported in the Windows Event Log. If an error page is displayed instead of the 
expected page, also look for the reason in the logs\error.log file.

ngnix停止、退出、重启:

nginx -s stop	  fast shutdown
nginx -s quit	  graceful shutdown
nginx -s reload	  changing configuration, starting new worker processes with a new configuration, graceful shutdown of old worker processes
nginx -s reopen	  re-opening log files

For example, to stop nginx processes with waiting for the worker processes to finish serving current requests, the following command can be executed:

nginx -s quit

修改了nginx的配置之后需要执行reload命令重新加载配置:

nginx -s reload
检查配置文件格式是否正确
nginx -t
D:\nginx\nginx-1.25.3>nginx.exe -t
nginx: the configuration file D:\nginx\nginx-1.25.3/conf/nginx.conf syntax is ok
nginx: configuration file D:\nginx\nginx-1.25.3/conf/nginx.conf test is successful

 

3.nginx常用命令  

查看nginx版本:
D:\nginx\nginx-1.25.3>nginx -v
nginx version: nginx/1.25.3

或者:

D:\nginx\nginx-1.25.3>nginx.exe -v
nginx version: nginx/1.25.3

 

 

 

 

 

 

 

--

posted on 2024-02-03 11:00  有点懒惰的大青年  阅读(96)  评论(0)    收藏  举报