nginx 入门


1. 下载相应的安装包,http://nginx.org/en/download.html;

2. 解压到(C:/nginx-1.18.0)  

在浏览器地址栏输入:127.0.0.1,会看到如下图所示的nginx欢迎界面

相应的命令:

start nginx.exe                       //启动命令

nginx.exe -s stop                   //停止nginx

nginx.exe -s reload                //重新加载nginx

nginx.exe -s quit                   //退出nginx

注:以上的命令中,.exe可以去掉

3. 各种配置

比如nginx配置文件为nginx.conf


   测试:

1. 在html文件夹中加入,test.html文件

2.配置conf/nginx.conf中加入

    server {
        listen        8084;
        server_name   localhost;
        location / {
            root   html;
            index  test.html test.htm;
        }
    }

3. 重启nginx服务

C:\nginx-1.18.0> ./nginx.exe -s reload 

在浏览器输入 127.0.0.1:8084即可