Nginx 文件服务器 介绍

下载nginx

http://nginx.org/en/download.html

解压:

打开conf/nginx.conf

 

添加

autoindex on;# 显示目录

       autoindex_exact_size on;# 显示文件大小

       autoindex_localtime on;# 显示文件时间

 

       server {

              listen       6868 default_server;

              listen       [::]:6868 default_server;

              server_name  _;

              root         /soft/nginx-1.14.2/data;  #//相对于盘符的相对路径 或者绝对路径

F:/soft/nginx-1.14.2/data linux也是一样/usr/local/

 

              location / {

              }

 

              error_page 404 /404.html;

                     location = /40x.html {

              }

 

              error_page 500 502 503 504 /50x.html;

                     location = /50x.html {

              }

       }

运行

Nginx 文件服务器 介绍

 

 

Nginx 文件服务器 介绍

查看nginx的版本号:nginx -v

 

启动nginx:start nginx

 

快速停止或关闭nginx:nginx -s stop

 

正常停止或关闭nginx:nginx -s quit

 

配置文件nginx.conf修改重装载命令:nginx -s reload