These are specific directives for vidmax.com. For their preview / thumbnail images, vidmax.com uses a file-exists check to either serve a cached image from disk, or send the request to a php-controller which creates the image and then serves it. The standard Yavli proxy configuration clashes with this, but the below directives have been designed to be compatible with the preview / thumbnail images.
Please note that the below directives include partial configuration directives from the supplied NGINX config. This is here to provide a contextual explanation for how and where the Yavli configuration directives should be implemented.
...snip... location ~ \.php$ { root $homedir/public_html; try_files $uri /index.php?route=$uri&$args; fastcgi_pass unix:/tmp/php-fpm.socket; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $homedir/public_html$fastcgi_script_name; include fastcgi_params; # enable NGINX to intercept PHP errors fastcgi_intercept_errors on; # if the file query arg ends in an image suffix, set @yavli as 404 error handler if ($arg_file ~ .*\.(jpg|jpeg|png|gif)$) { error_page 404 = @yavli; } } location @yavli { # rewrite the file arg back into the URI rewrite ^(.*)$ /$arg_file? break; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Host $host; proxy_pass http://steg.yavli.com; } ...snip...