After updating to PHP 7.2 --> NGINX reload failed



I installed EE with --wpredis --letsencript – php7. Then I updated to PHP 7.2 according to Virtubox ( After the last step of editing vhost like this:

include common/redis-php72.conf; include common/wpcommon-php72.conf; include common/locations-php72.conf;

I get this error message:

Reload : nginx [Failed] service nginx reload failed. check issues with nginx -t command

Can anyone help me?

Many thanks!!!


What’s the output of that command?


Hi emanweb

Thanks for helping me!

That’s the output of nginx -t:

nginx: [emerg] unknown “webp_suffix” variable

nginx: configuration file /etc/nginx/nginx.conf test failed



After commenting out the rule regarding webp in these files, nginx restarts fine. But there should be a better solution to teach nginx what that webp_suffix variable actually is. There seems something missing in the tutorial we both followed.

/etc/nginx/common/wpcommon-php7.conf:        try_files $uri$webp_suffix $uri =404;
/etc/nginx/common/wpcommon-php72.conf:        try_files $uri$webp_suffix $uri =404;
/etc/nginx/common/wpcommon-php71.conf:        try_files $uri$webp_suffix $uri =404;



the issue is due to the webp rewrite directives added few weeks ago to our configurations files. It require to add the webp mapping configuration in /etc/nginx/conf.d/webp.conf with the following content :

map $http_accept $webp_suffix {
   default "";
   "~*webp" ".webp";

You can create it with the command :

echo -e '\nmap $http_accept $webp_suffix {\n   default "";\n   "~*webp" ".webp";\n}' > /etc/nginx/conf.d/webp.conf

I will update our article to add this required step.


Thank you very much! Now everything works fine!


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.