时间: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 #重载配置文件
2023-02-28
解决linux不识别nfst格式u盘问题技巧 linux无法识别ntfs格式U盘怎么办?2023-02-28
linux扩容swap分区的技巧 linux怎么调整swap大小?2023-02-26
微软Linux资源库首次加入Edge浏览器稳定版当linux在运作时不能直接关闭电源容易将档案系统损毁,因此需要用shutdown以安全的方式关闭,那么这个操作该怎么实现呢?下面就为大家带来了详细教程。...
2022-11-07
由于linux系统和我们常用的windows系统是不一样的,所以如果是初学者,可能会不知道linux怎么强制删除文件,其实我们只要打开终端,使用命令就可以删除了。...
2022-11-03