注意要使用alias ,而不是root,不然无效
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
}
location /static/ {
autoindex_localtime on;
alias H:/data/images/;
autoindex on;
}
}
附上 start stop.bat
nginx.exe -s reload start nginx chcp 65001 echo "-------------nginx--------启动成功------------" pause
taskkill /f /t /im nginx.exe chcp 65001 echo "-------------nginx--------关闭成功------------"



