I'm trying to match a location that looks like this /v1/images/{path1}/fetch?imageUrl={imageUrl}
, but I get this error in the terminal [error] 7#7: *1 open() "/usr/local/openresty/nginx/html/v1/images/raw/fetch"
whenever I try to make an example request for the variables in the GET route.
map $arg_imageUrl $image_ext {
default "";
~*\.([a-zA-Z]+)$ $1;
}
server {
listen 80;
location "/v1/images/{path1}/fetch?imageUrl={imageUrl}" {
if ($args ~* "imageUrl=.*") {
set_sha1 $variable $arg_imageUrl;
set $path1 $arg_path1;
set $imageUrl "https://testing-url/test-properties/images/$variable/$path1.$image_ext";
add_header Content-Type text/plain;
return 200 $imageUrl;
# proxy_pass $imageUrl;
# access_log ./log_file.log combined;
}
}
}