tags:

views:

33

answers:

2

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.

Where is a problem?

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

A: 

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.

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).

msw
I'd go for image/svg+xml, that's what Apache will send by default.
robertc
If you refer to an out-of-date working-draft spec then that's what you get. The SVG 1.1 (and 1.2T) recommendations (read: "most mature/stable spec version") both say "image/svg+xml".
Erik Dahlström
A: 

I fixed it. I added to /etc/nginx/mime.types

image/svg+xml svg svgz;

Then I checked that server responses correctly

wget -O - -S http://proximax.ru/media/content/final/avW30U.svg > /dev/null
..
Content-Type: image/svg+xml
..

Also I turned off other virtual spaces for be clear.

mapcuk