微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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即可

 

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐