Kirk Sefchik
Kirk Sefchik

Reputation: 813

NGINX treating SVG as Plain Text

I have a image I'm trying to load from SVG file. However, my mime.types file on my nginx server has the correct line present:

...
image/svg+xml svg svgz;
...

When I try to download the file, the server is saying it is plain text:

$ wget -O - -S http://172.22.253.119:2998/tw-logo-on-dark-2.svg > /dev/null
--2018-06-26 09:05:06--  http://172.22.253.119:2998/tw-logo-on-dark-2.svg
Connecting to 172.22.253.119:2998... connected.
HTTP request sent, awaiting response...
  HTTP/1.1 200 OK
  Server: nginx/1.13.12
  Date: Tue, 26 Jun 2018 14:05:06 GMT
  Content-Type: text/plain
  Content-Length: 26706
  Last-Modified: Mon, 25 Jun 2018 16:05:40 GMT
  Connection: keep-alive
  ETag: "5b3112d4-6852"
  Accept-Ranges: bytes
Length: 26706 (26K) [text/plain]
Saving to: ‘STDOUT’

Can anyone tell me what I'm doing wrong?

Upvotes: 3

Views: 3433

Answers (1)

Kirk Sefchik
Kirk Sefchik

Reputation: 813

The solution was to include this in my nginx.conf:

http {
  include /etc/nginx/mime.types; # This includes the built in mime types
}

Upvotes: 10

Related Questions