Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error loading SVG - ERR_CONTENT_DECODING_FAILED

I have a server running Nginx with the Google Pagespeed module installed.

Up until recently, I had no issues with SVGs on my website, however now Chrome is giving me the error: Failed to load resource: net::ERR_CONTENT_DECODING_FAILED

The image is located in: /images/bg.svg

Manually loading the image with a random query parameter ie. bg.svg?v=2 loads the SVG normally without errors so perhaps it's a caching issue.

How can I go about troubleshooting this problem?

like image 243
r553 Avatar asked Jun 09 '26 13:06

r553


1 Answers

Have a look at the discussion behind this link https://github.com/pagespeed/ngx_pagespeed/issues/1346

Same error is discussed as a ngx_pagespeed issue. Solution that worked for me was adding this to my nginx config:

pagespeed Disallow "*.svg";

More info about it: https://modpagespeed.com/doc/restricting_urls

like image 111
Pyry Liukas Avatar answered Jun 12 '26 13:06

Pyry Liukas