nginx文件服务器

1.安装nginx:
[root@test data]#yum install nginx -y 



2.编辑配置文件: [root@test data]#vim /etc/nginx/nginx.conf 添加如下: autoindex on; ##显示目录 autoindex_exact_size on; ##显示文件大小 autoindex_localtime on; ##显示文件时间 server { listen 80 default_server; # listen [::]:80 default_server; server_name _; # root /usr/share/nginx/html; root /data; # Load configuration files for the default server block. include /etc/nginx/default.d/*.conf; location / { } error_page 404 /404.html; location = /40x.html { }

3.重启服务: [root@test data]#systemctl restart nginx

4.访问测试:


 

posted @ 2019-11-06 12:58  ccbky  阅读(155)  评论(0编辑  收藏  举报