• 有时候在服务器上配置某些文件比如TXT文件,在浏览器打开的时候,会弹出下载。如何只让他在浏览器中显示,而不是下载呢。在nginx配置文件中添加一行代码
    add_header Content-Type text/plain;  //文件内容以文本格式显示

    //例如 location = /md/test.txt { //匹配到这里,显示文件内容,而不是下载 root /home/wwwroot/default; add_header Content-Type text/plain; }

     

相关文章:

  • 2021-11-28
  • 2021-11-28
  • 2021-10-28
  • 2022-12-23
  • 2022-12-23
  • 2021-08-22
  • 2021-06-03
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-03
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案