L
L
lagudal2019-11-15 11:24:43
Nginx
lagudal, 2019-11-15 11:24:43

How to make normal support for webp images in nginx under ubuntu server 14.04?

There is a vps on which ubuntu 14.04, there is nginx version 1.4.6. There is no way to update the OS yet, and you still have to be careful with nginx.
If I understand correctly, nginx of this version in the standard configuration does not support webp normally, and gives these pictures to chrome as an "unknown format" -
5dce60af02290483956294.jpeg
At the same time, the pictures themselves in the html page are displayed normally - chrome knows them. But if you try to open a direct link to the picture, then the tab opens for a moment and immediately closes, and the picture itself is automatically downloaded.
Not that it bothered me much, but still - where to fix something in the config to add webp support?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lynn "Coffee Man", 2019-11-15
@lagudal

Find a file with MIME types in /etc/nginx , usually /etc/nginx/mime.types
Add a line to it
image/webp webp;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question