进入nginx/conf
修改nginx.conf文件,添加红色区域内容:
server {
listen 80;
server_name localhost;
server_name gravatar.com;
#charset koi8-r;
#access_log logs/host.access.log main;
location /release {
#root /data/www/file
alias D:/XXX/release;
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
}
}
alias如果不生效,可以试root
浏览器访问:http://ip:80/release
本文详细介绍如何在Nginx中配置文件服务器,包括监听端口、设置域名、指定文件目录及开启目录浏览功能等步骤。通过修改nginx.conf文件,实现HTTP访问下文件的自动索引和显示。
1847

被折叠的 条评论
为什么被折叠?



