this topic is to help people who are struggling with installing smush on hestiacp.
i have tried everything to make it work and will offer you my solution:
1- i removed the images extensions from nginx proxy
2- i edited the code in the .htaccess file, the smush pro offers you a code that will not work, you should replace it with this one:
# BEGIN SMUSH-WEBP
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}/wp-content/smush-webp/disable_smush_webp !-f
RewriteCond %{HTTP_ACCEPT} image/webp
RewriteCond %{DOCUMENT_ROOT}/wp-content/smush-webp/$1.webp -f
RewriteRule wp-content/uploads/(.*\.(?:png|jpe?g))$ wp-content/smush-webp/$1.webp [NC,T=image/webp]
</IfModule>
<IfModule mod_headers.c>
Header append Vary Accept env=WEBP_image
</IfModule>
<IfModule mod_mime.c>
AddType image/webp .webp
</IfModule>
# END SMUSH-WEBP
you can use the logic in this code with any other plugin that serves webp locally.
That’s all, good luck!