WebP Express Wordpress plugin cannot detect that mod_headers or mod_rewrite is enabled

Hello, this is a continuation of the discussion at this link as it seems to have been closed due to inactivity without a resolution:

I am essentially seeing exactly the same messages that the OP was seeing throughout the process. I used a2enmod headers to enable headers, restarted apache and rebooted the server, and can confirm the mod headers and mod rewrite are enabled.

In that user’s last post I noticed an error message, that I was also seeing:

AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using host.MYDOMAIN.com. Set the ‘ServerName’ directive globally to suppress this message

I followed digitalocean’s instructions and was able to resolve that error. Restarted apache and rebooted the server again. Still the same issues.

Now I’m not sure what else I can do. The webp express plugin is currently giving me the following error messages:

It seems your server setup does not support headers in .htaccess . You should either fix this (install mod_headers ) or deactivate the “Enable direct redirection to existing converted images?” option. Otherwise the Vary:Accept header will not be added and this can result in problems for users behind proxy servers (ie used in larger companies)

And when clicking system info:

System info:
- PHP version: 8.0.21
- OS: Linux
- Server software: Apache/2.4.54 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/3.0.2
- Document Root status: Available and its "realpath" is available too. Can be used for structuring cache dir.
- Document Root: /home/virgil/web/cyclical.virgil.codes/public_html
- Document Root: Available and its "realpath" is available too. Can be used for structuring cache dir.
- Apache module "mod_rewrite" enabled?: could not be determined
- Apache module "mod_headers" enabled?: could not be determined

When visiting my site I can confirm that webp files are not being delivered.

Any ideas? Help would be much appreciated!

Webp Express allows you to run tests. While the system info detects the server as apache, the live tests detect the server as being nginx. Here’s the relevant output:

Lets check that browsers supporting webp gets the WEBP when the JPEG is requested
Making a HTTP request for the test image (pretending to be a client that supports webp, by setting the "Accept" header to "image/webp")
Request URL: https://cyclical.virgil.codes/wp-content/uploads/webp-express-test-images/6OB1Ko.JPEG
Response: 200 OK
Response headers:
- server: nginx
- date: Thu, 28 Jul 2022 08:16:25 GMT
- content-type: image/jpeg
- content-length: 3195
- last-modified: Thu, 28 Jul 2022 08:16:25 GMT
- etag: "62e245d9-c7b"
- expires: Thu, 31 Dec 2037 23:55:55 GMT
- cache-control: max-age=315360000
- accept-ranges: bytes

Bummer. As the "content-type" header reveals, we got the jpeg.
Additionally, the content-length reveals that we did not get the webp (we know that the file we put is exactly 6964 bytes). So we can conclude that the rewrite did not happen
The test FAILED.
Diagnosing rewrites
Notice that you are on Nginx and the rules that WebP Express stores in the .htaccess files probably does not have any effect.
Please read the "I am on Nginx" section in the FAQ (https://wordpress.org/plugins/webp-express/)
And did you remember to restart the nginx service after updating the configuration?
PS: If you cannot get the redirect to work, you can simply rely on Alter HTML as described in the FAQ.
Deleting test images

So I went to that FAQ, followed the second set of instructions to edit the nginx config, and now the wordpress site seems to be intermittently serving webp files. On pages with a lot of images that have not yet been converted, I’m getting extremely sluggish performance followed by 500 error codes until I reboot the server.

To boot, I’m still seeing all these errors in the webp express plugin dashboard. :frowning: