Quantcast
Channel: Nginx Forum - Other discussion
Viewing all articles
Browse latest Browse all 972

Nginx won't serve svg files

$
0
0
I'm fairly new to nginx, and am just trying to set up a simple static content example on my raspberry pi 3A+ but I can't get it to serve svg files. In the example below, the png image shows fine, but the svg files all show the alt text only. I have reviewed the documentation and all the forums I can find and I have tried everything - no luck. I tried browsing this from localhost and two other pc's on my LAN - same result.

Here's the /etc/nginx/nginx.conf file

user pi;
events{}
http {
server {
listen 80;
server_name localhost;
root /home/pi/DigitalClock/dcvenv;
index /static/index.html;
location / {
autoindex on;
}
}
}

The entry in the /etc/nginx/mime.types file is (i did not alter the file at all)
image/svg+xml svg svgz;

here's my /static/index.html

<html>
<img src="/static/admin/img/pic01.png" alt="Search"></label>
<img src="/static/admin/img/icon-yes.svg" alt="icon yes"></label>
<img src="/static/admin/img/search.svg" alt="icon yes"></label>
<img src="/static/admin/img/sorting-icons-yes.svg" alt="icon yes"></label>
</html>

all the files are present in the specified directory and permissions are set the same from root on downward as owner=rwx, group=x, other=x

nginx start command: sudo service nginx start

Viewing all articles
Browse latest Browse all 972


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>