Nginx的安装步骤略,网上有很多。
直接从修改配置文件开始。配置文件路径/etc/nginx/nginx.conf
cd /etc/nginx/
vi nginx.conf
打开配置文件后,下面有中文注释的一共7行,改好保存。
#前面略
autoindex on; # 显示文件目录
autoindex_exact_size on; # 显示文件大小
autoindex_localtime on; # 显示文件时间
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Load modular configuration files from the /etc/nginx/conf.d directory.
# See http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
include /etc/nginx/conf.d/*.conf;
server {
listen 8080; # 默认是80
server_name www.XXX.com; # 本地就写localhost
charset utf-8; # 中文名的文件不乱码.
root /alidata/shareFile; # 设置文件服务器的根目录
# Load configuration files for the default server block.
include /etc/nginx/de