server {
listen 80;
server_name localhost;
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
charset utf-8;
--这是linux
location / {
root /mnt/d/TDDownload;
# C、D盘都在 /mnt 目录下,这里是挂载的 D 盘 TDDownload 目录,
}
--这是windows
location /share{ #在server下新建一个location
alias D:\share;
autoindex on; #开启自动索引功能,将共享目录下的文件整合成页面
}
}