nginx展示目录及美化
1.下载nginx
2.下载fancyindex
git clone https://github.com/aperezdc/ngx-fancyindex.git ngx-fancyindex
3.下载主题
git clone https://github.com/lanffy/Nginx-Fancyindex-Theme.git
编译安装
./configure --prefix=/usr/local/nginx --add-module=../ngx-fancyindex/
make && make install
mv /root/Nginx-Fancyindex-Theme /usr/local/nginx/html/
nginx配置
location /download{
include /usr/local/Cellar/nginx/1.12.2_1/html/Nginx-Fancyindex-Theme/fancyindex.conf; # 目录美化配置
alias /Users/mac-desktop/video/; #指定目录所在路径
autoindex on; #开启目录浏览
autoindex_format html; #以html风格将目录展示在浏览器中
autoindex_exact_size off; #切换为 off 后,以可读的方式显示文件大小,单位为 KB、MB 或者 GB
autoindex_localtime on; #以服务器的文件时间作为显示的时间
charset utf-8,gbk; #展示中文文件名
}
效果如下
或者不使用主题
location / {
alias /data/;
fancyindex on; # 使用fancyindex
fancyindex_exact_size off; # 不显示精确大小
}
效果如下
nginx展示目录及美化的更多相关文章
- Nginx浏览目录配置及美化
https://segmentfault.com/a/1190000012606305 在项目中有一个功能需要在浏览器页面中浏览服务器的目录.服务器使用Nginx,而Nginx提供了相应的ngx_ht ...
- nginx下目录浏览及其验证功能配置记录
工作中常常有写不能有网页下载东西的需求,在Apache下搭建完成后直接导入文件即可达到下载/显示文件的效果;而Nginx的目录列表功能默认是关闭的,如果需要打开Nginx的目录列表功能,需要手动配置, ...
- Linux下查看Nginx安装目录、版本号信息?
Linux环境下,怎么确定Nginx是以那个config文件启动的? 输入命令行: ps -ef | grep nginx 摁回车,将出现如下图片: master process 后面的就是 ngi ...
- web服务器【apache/nginx] 关闭目录的浏览权限
web服务器[apache/nginx] 关闭目录的浏览权限 我的配置(将Options 中的Indexes干掉): <VirtualHost *:80> ServerAdmin webm ...
- nginx禁止目录php执行权限
nginx禁止目录php执行权限,找到配置fastcgi.conf文件,一般在/usr/local/nginx/conf/下面,修改如下 location ~* ^/(data|uploads|tem ...
- Nginx 开启目录下载
平时应用中,我们大都用apache搭建下载页面.毕竟Apache搭建起来非常方便,yum安装,创建目录就可以了. 但有时还是需要用nginx配置下载页面.这里就是一个简单的配置nginx下载页面的过程 ...
- nginx下目录浏览及其验证功能、版本隐藏等配置记录
工作中常常有写不能有网页下载东西的需求,在Apache下搭建完成后直接导入文件即可达到下载/显示文件的效果;而Nginx的目录列表功能默认是关闭的,如果需要打开Nginx的目录列表功能,需要手动配置, ...
- Nginx 指令目录(中文版)
指令大全 accept_mutex accept_mutex_delay access_log add_after_body add_before_body add_header addition_t ...
- nginx基于目录的映射:
nginx基于目录的映射: location /wxchat/ { #proxy_redirect off; proxy_set_header Host $host; proxy_set_header ...
随机推荐
- ZJUT11 多校赛补题记录
牛客第一场 (通过)Integration (https://ac.nowcoder.com/acm/contest/881/B) (未补)Euclidean Distance (https://ac ...
- E. Covered Points (线段上的整点数)
题目链接:https://codeforces.com/contest/1036/problem/E 思路:学会了一个在线段上的整数点等于 GCD(x1 - x2, y1 - y2) + 1,然后去 ...
- composer 配置镜像
阿里云镜像:composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ 腾讯云镜像:composer ...
- shell编程:利用脚本实现nginx的守护自动重启
nginx_daemon.sh #!/bin/bash # this_pid=$$ while true do ps -ef | grep nginx | grep -v grep | grep -v ...
- Python面试题之这两个参数是什么意思:*args,**kwargs?我们为什么要使用它们?
如果我们不确定要往函数中传入多少个参数,或者我们想往函数中以列表和元组的形式传参数时,那就使要用*args: 如果我们不知道要往函数中传入多少个关键词参数,或者想传入字典的值作为关键词参数时,那就要使 ...
- html 中手写阴影弹窗框封装
// 弹出提示框 function popup(pWidth,content) { $("#msg").remove(); var html ='<div id=" ...
- 挂载时出现mount: RPC: Unable to receive; errno = Connection refused错误的解决方法
当我们在做NFS开发板下挂载时,经常会出现mount: RPC: Unable to receive; errno = Connection refused的错误,连接被拒绝了,到底是什么原因呢? 这 ...
- compiz隐藏最大化窗口标题栏
xfwm换了compiz试试,还行,挺方便.就是这个隐藏最大化窗口的标题栏没有现成的ui设置项,google到如下解决方案: 修改后立即生效. https://planetkris.com/2009/ ...
- 在Mac OS终端的Terminal 中使用Sublime Text3
查看环境变量: $ echo $PATH $ /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin 创建软链接: $ sudo ln -s /Application ...
- (二)Django连接本地mysql异常
Pycharm连接数据库出现错误 管理员身份进入mysql数据库 命令: mysql -u root -p 重新进入mysql 在进入Pycharm发现连接成功