添加以下代码到配置文件···location / { if ($request_filename ~* ^.*?.(txt)$){ add_header Content-Disposition attachment;}}···