1

I'm using a location config like this in Nginx for serving WEBP when the user supports it

    map $http_accept $webp_suffix {
        default   "";
        "~*webp"  ".webp";
    }

    server {
    #...
        location ~* \.(?:jpg|jpeg|png|webp)$ {
            root   /usr/share/nginx/html;
            try_files $uri$webp_suffix $uri =404;
        }
    #...
    }

my problem is that I want to use the same strategy but when I'm using an object-storage (Minio - S3 compatible)

so I'm wondering what is the best way to replace this part:

try_files $uri$webp_suffix $uri =404;

with something like

try_proxy_pass http://minio$uri$webp_suffix http://minio$uri =404;
erfan
  • 11
  • 2
  • Why would you `proxy_pass` to an object storage provider? That will negate most of the benefits of using object storage provider, because all the requests for images have to still go through your server? Also, `image_filter` is a filter running on your nginx server. It cannot do anything to the images in object storage. – Tero Kilkanen Jul 27 '22 at 14:19
  • 1
    First Because Im hosting my own HA minio object storage cluster secondly currently im testing that and image_filter also works with proxy_pass to minio – erfan Jul 28 '22 at 15:58
  • also, I edited my question to be less confusing – erfan Jul 28 '22 at 17:15

0 Answers0