• csb1024

    (@csb1024)


    It appears to be a problem with NGINX rewrite rules for WebP display.

    From a user:

    I got the following error when running nginx -t :

    – invalid parameter “final” in /usr/local/nginx/conf/vhost/www.xxx.com.conf:127 –

    Current recommended NGINX rules by us:

    # BEGIN Imagify: rewrite rules for webp
    location ~* ^(/.+)\.(jpg|jpeg|jpe|png|gif)$ {
    	add_header Vary Accept;
    
    	if ($http_accept ~* "webp"){
    		set $imwebp A;
    	}
    	if (-f $request_filename.webp) {
    		set $imwebp  "${imwebp}B";
    	}
    	if ($imwebp = AB) {
    		rewrite ^(.*) $1.webp final;
    	}
    }
    # END Imagify: rewrite rules for webp
    • This topic was modified 6 years ago by csb1024.

The topic ‘WebP rewrite rules from NGINX issue’ is closed to new replies.