I'm trying to match a location url to this format /v1/images/{path1}/fetch?imageUrl={imageUrl}
and I managed to do so with this snippet of code
location ~ ^/v1/images/(?<path1>[^/]+)/fetch {
if ($args ~* "imageUrl=.*") {
set $path1 $arg_path1;
set_sha1 $variable $arg_imageUrl;
set $imageUrl "https://testing.com/test/images/$variable/$path1.$image_ext";
return 200 $imageUrl;
add_header Content-Type text/plain;
proxy_pass $imageUrl;
access_log /etc/nginx/conf.d/log_file.log traffic;
}
}
But, I'm supposed to have a value for the path1 variable here returned in the response, but I don't get anything. I'm not sure why it's not being returned here, as it's part of the request too. Am I doing something wrong ?