时间:2020-07-09来源:www.pcxitongcheng.com作者:电脑系统城
1 [root@nginx01 ~]# mkdir /download #创建Nginx服务端下载目录 2 [root@nginx01 ~]# cp /etc/nginx/conf.d/default.conf /download/ 3 [root@nginx01 ~]# cp /etc/nginx/ /download/ #创建测试文件
1 [root@nginx01 ~]# vi /etc/nginx/conf.d/down.conf
2 server {
3 listen 80;
4 server_name download.linuxds.com;
5 location /down {
6 alias /download;
7 access_log /var/log/nginx/down.access.log main;
8 error_log /var/log/nginx/down.error.log warn;
9 autoindex on;
10 autoindex_localtime on;
11 autoindex_exact_size off;
12 charset utf-8,gbk;
13
14 if ($request_filename ~* ^.*?\.(txt|doc|pdf|rar|gz|zip|docx|exe|xlsx|ppt|pptx|conf)$)
15 {add_header Content-Disposition 'attachment;';}
16 }
17 }
1 [root@nginx01 ~]# nginx -t -c /etc/nginx/nginx.conf #检查配置文件 2 [root@nginx01 ~]# nginx -s reload #重载配置文件

2024-07-18
Centos 7 二进制安装配置 MariaDB数据库2024-07-18
Centos7默认firewalld防火墙使用命令大全2024-07-07
四种执行python系统命令的方法常用权限linux系统内有档案有三种身份 u:拥有者 g:群组 o:其他人这些身份对于文档常用的有下面权限:r:读权限,用户可以读取文档的内容,如用cat,more查看w:写权限,用户可以编辑文档x...
2024-07-07
然而,如果我们遵循通常的 WordPress 最佳实践,这些安全问题可以避免。在本篇中,我们会向你展示如何使用 WPSeku,一个 Linux 中的 WordPress 漏洞扫描器,它可以被用来找出你安装...
2024-07-03