nginx 配置txt下载(nginx proxy配置)

server{
    listen 80;
    server_name www.shnne.com;
    access_log  /data/log/nginx/access_shnne.log;
    root /web/shnne;
    location /  {
        index index.php index.html;
    # 添加如下内容
    if ($request_filename ~* ^.*?\.(txt|pdf|doc|xls)$){ 
        add_header Content-Disposition: 'attachment;'; 
     } 
    }
}


标签:

上一篇CentOS7升级pip2成功后执行报错(centos7升级openssh8.8)
下一篇Linux运维掌握的一些实用工具

相关文章