<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  
  
  <channel>
    <title>chrisjrob: nginx</title>
    <link>https://chrisjrob.com</link>
    <atom:link href="https://chrisjrob.com/tag/nginx/feed/index.xml" rel="self" type="application/rss+xml" />
    <description>GNU Linux, Perl and FLOSS</description>
    <language>en-gb</language>
    <pubDate>Fri, 13 Feb 2026 17:22:31 +0000</pubDate>
    <lastBuildDate>Fri, 13 Feb 2026 17:22:31 +0000</lastBuildDate>
    
    <item>
      <title>Fixing SVG Files in DokuWiki</title>
      <link>https://chrisjrob.com/2022/01/27/fixing-svg-files-in-dokuwiki/</link>
      <pubDate>Thu, 27 Jan 2022 10:00:00 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2022/01/27/fixing-svg-files-in-dokuwiki</guid>
      <description>
       <![CDATA[
         
           <img src="https://chrisjrob.com/assets/dokuwiki.gif" align="right" alt="Featured Image">
         
         <p>Having upgraded a DokuWiki server from 16.04 to 18.04, I found that SVG images were no longer displaying in the browser.
As I was unable to find any applicable answers on-line, I thought I should break my radio silence by detailing my solution.</p>

<!--more-->

<p>Inspecting the file using browser tools, Network and refreshing the page showed that the file was being downloaded as octet-stream.
Sure enough using curl showed the same.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl -Ik https://example.com/file.svg
</code></pre></div></div>

<p>All the advice on-line is to ensure that <code class="language-plaintext highlighter-rouge">/etc/nginx/mime-types</code> includes the line:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>image/svg+xml   svg svgz;
</code></pre></div></div>

<p>But that was already in place.</p>

<p>I decided to try uploading the SVG file again, in case the Inkscape format was causing breakage.  Yes, a long-shot indeed.</p>

<p>The upload was rejected by DokuWiki, as SVG was not in the list of allowed file extensions; so I added the following line to <code class="language-plaintext highlighter-rouge">/var/www/dokuwiki/conf/mime.local.conf</code>:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>svg   image/svg_xml
</code></pre></div></div>

<p>Whereon the images started working again.
Presumably Dokuwiki was seeing the mime-type as <code class="language-plaintext highlighter-rouge">image/svg</code> instead of <code class="language-plaintext highlighter-rouge">image/svg+xml</code> and this mismatch was preventing nginx serving up the correct content-type.</p>

<p>Hopefully this will help others, do let me know if it has helped you.</p>


       ]]>
      </description>
    </item>
    
  </channel> 
</rss>
