介绍
只要访问www.show.cc:81/book
就能访问到服务器上/usr/local/book目录下的文件
server {
listen 81;
server_name www.show.cc;
location /book {
alias /usr/local/book;
# 开启目录列表访问,合适下载服务器,默认关闭。
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
}
location / {
root html;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}