Nginx reverse proxy server .webp

I’ve looked at this forum and I’ve looked to Google.
It’s very hard to find stuff Nginx reverse proxies.

I want to serve .webp. I’ve tried any tutorials and nothing works. I don’t is it’s a modual missing from nginx.

I was the proxy to change WordPress images to webp if supported by client. I know how to do it in the pantry and that doesn’t work if they’re not making a call to Apache but being served the proxy.

Has anyone else had any experience with this, possibly point me in the right direction or have a working code snippet? Would appreciate the help. I figured here at least you guys would know how to make it work with Hestia setup.

I’m on Ubuntu 18.04 lts and latest Hestia. My webp files have the same name as a counterpart and are in the same folder just .webp is added so xxx.jpg.webp for xxx.pbg.webp. they’re converted by a Cron script.

I also know this convened on WordPress but that doesn’t work very well either for the same reasons as apache.

Any help appreciated thank you

Probaly this (https://gist.github.com/tuankiet/27252dbed8c1e1cabda79dfca91acad5) in combination with this here could help you: https://docs.hestiacp.com/admin_docs/server_management.html#how-do-web-templates-work

Don’t have .webp in use, but if it works with nginx, it also works with hestia :slight_smile:.

2 Likes

the few ways i tried failed so i was’t sure if there in a modual that needs to be compiled in that is not in hestias nginx

I think you missunderstood how hestia is working: There is no “hestia nginx” as frontend proxy, it is a default nginx from their repository without and special mods - so you also can adjust it like you want. The only hestia-nginx service is used for the interface/backend only and is not related to the frontend proxy.

If I need to recompile modules into nginx is that safe to do? Do I need to make any changes to the normal process to no cause issues?

No, there are no changes needed - expect you may set nginx on app hold to prevent any unwanted upgrades.

Ok thank you. I wasn’t sure if doing so would have broken the hestia integration.

@djav1985, @ScIT If you want to install and use Webp you can try the following:

This is what I install before installing Hestia as it will enable webp for all php versions that get installed when Hestia installs. Should work with Hestia already installed as well

Note: Versions listed of Webp and ImageMagick are from last time installed and updated install details in my server / vps setup checklist.

I also use Ubuntu 18.04 and install Webp this way, does not break on updates.
Used on Opencart 2.3.0.2 and 3.0.3.1, PHP 7.1 and 7.4 (with webp extension to enable use)

Fix apt is to install packages required by ImageMagick

Fix apt
sudo cp /etc/apt/sources.list /etc/apt/sources.list~
sudo sed -Ei ‘s/^# deb-src /deb-src /’ /etc/apt/sources.list
sudo apt-get update

Then you need to download and extra / Install ImageMagick/Webp

sudo apt-get install build-essential -y
sudo apt-get build-dep imagemagick -y

go to /usr/src/ then

wget http://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.1.0.tar.gz
tar xf libwebp-1.1.0.tar.gz

then

wget http://www.imagemagick.org/download/ImageMagick.tar.gz
tar xf ImageMagick.tar.gz

Webp dependancies

sudo apt-get install libjpeg-dev libpng-dev libtiff-dev libgif-dev -y

Compile Webp

cd libwebp-1.1.0
./configure --prefix=/usr
make
sudo make install
cd …

Compile ImageMagick

cd ImageMagick-7.0.9-25. <------ check extracted version folder it was this last time installed

./configure --prefix=/usr
make
sudo make install
cd …

Reboot

or you can try simple version not from source

sudo apt-get install webp libwebp-dev -y

1 Like