0
点赞
收藏
分享

微信扫一扫

用Nginx搭建静态资源网站(文件服务器,图片服务器,静态HTML等)

前端王祖蓝 2022-08-04 阅读 218


介绍

只要访问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;
}
}



举报

相关推荐

0 条评论