Nginx提供下载SVG而不是显示它 [英] Nginx offers to download SVG instead of showing it

查看:306
本文介绍了Nginx提供下载SVG而不是显示它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在HTML或单独的选项卡中显示SVG文件,但Nginx允许我下载它. 我获取了正常的SVG文件,该文件可以在其他站点上运行,但不能在我的服务器上运行.

I try to show SVG file in HTML or separate tab but Nginx offers me to download it. I took normal SVG file which works on another site but not in my server.

哪里有问题?

以下是示例 http://proximax.ru/media/content/final /plane2.svg 同样是HTML的SVG http://proximax.ru/index/

Here is an example http://proximax.ru/media/content/final/plane2.svg Also here SVG in HTML http://proximax.ru/index/

推荐答案

The of your image is noted as application/octet-stream which a browser can only offer to download as it does not know how to interpret it.

从您的index.html文件中可以明显看出您正在使用MIME类型的变体,并且不清楚该标准是否要求图片/svg + xml (或标准就是它们,完全是其他东西).

From your index.html file it is clear that you were playing around with variations of the MIME-type, and it is unclear whether the standard requires image/svg or image/svg+xml (or standards being what they are, something else entirely).

这篇关于Nginx提供下载SVG而不是显示它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆