Nginx won't serve svg files
February 23, 2019 02:47PM
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;
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

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

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

Edited 2 time(s). Last edit at 02/23/2019 02:52PM by smelehy.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 53
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready