nginx - 如何配置 nginx 以显示 .ipynb scipy 笔记本而不下载它们
问题描述
我试过如何配置 nginx 来显示文件内容而不是下载它?它对我不起作用。
这是我的 nginx 配置。
server {
listen 80;
root /home/splat/files;
index index.php index.html index.htm;
server_name files.kiwiheretic.xyz;
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
access_log /var/log/nginx/files.kiwiheretic.xyz.access.log combined;
error_log /var/log/nginx/files.kiwiheretic.xyz.eror.log;
location / {
autoindex on;
sendfile on;
types { text/plain ipynb; }
}
}
我已经尝试过使用ipynb和.ipynb的类型指令,但似乎都没有任何区别。目前有一个 ipynb 文件夹上传到服务器,您可以自己看到它只是下载而不是显示内容。(当我说显示它的内容时,我并不是说将其呈现为 scipy 笔记本,而只是显示原始 JSON 内容。)
还有什么我可以尝试的吗?
解决方案
推荐阅读
- c# - 在第一次记录水晶报告中显示总和
- c# - 如何在部署管道中正确配置数据库和集合?
- azure-service-fabric - Service Fabric 规模集上的存储空间不足
- c++ - 使用 OpenSSL 从内存中读取原始 SSL/TLS 证书
- python - 如何获取稀疏矩阵数据数组的对角线元素的索引
- c# - 如何使用 C# 或 F# 在 Windows 窗体上更新位图?
- vue.js - 异步任务在 vuejs 视图中不是响应式的
- python - 上传从 cv2.imdecode() 返回的图像时面临问题
- ruby - 如何在 ruby 中一次访问多行
- bash - 将字符从 Windows 转义到 WSL