Hi all.
The mission is to conditionally serve *.webp.
First of all i have map in my http section.
map $http_accept $webp_suffix {
default "";
"~*webp" ".webp";
}
The purpose of this map is to check if the user agent supports the webp.
The second thing we need somehow combine it in try_file.....
There is an example from config.
location ~
/resize/([-_0-9a-z]+)/([0-9a-z]+)/([0-9a-z]+)/([-_0-9a-z]+)\.jpg$ {
add_header Vary Accept;
And there i want to do something like:
try_files /resize/$1/$2/$3/$4$webp_suffix /resize/$1/$2/$3/$4.jpg =404
But it is not working.
The only thing is working is try_files $uri$webp_suffix $uri =404. But this
combination is checking for image_name.jpg.webp. but i need to look for
image_name.webp.
The question is how to concat 2 variables (one from regexp, the other one
from map definition) in try section.
Thanks.
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx