Skip to content

How to configure Image resizing as Proxy Mode #251

Closed
@sjahn90

Description

We have origin server for image content. We want to use image resizing as proxy server.
I found how to resize image as on-the-fly. https://www.endpoint.com/blog/2016/05/25/caching-resizing-reverse-proxying-image-server-nginx

So, we configure as follows. But we can't apply the image resizing.

example environment
Origin server (IP: 1.1.1.1 as Nginx server) <-> Image proxy server (IP: 2.2.2.2) <-> Test Client (IP: 3.3.3.3)

Configuration of image proxy server are as follow.

http {
  ~~
  proxy_cache_path /usr/local/nginx/cache levels=1:2 keys_zone=mycache:10m max_size=100m;
  ~~
  server {
      listen 80;
      server_name _;

      location / {
        proxy_pass http://127.0.0.1:81;
        proxy_cache_valid 200 60m;
        proxy_cache mycache;
        proxy_cache_key "$proxy_host$uri$is_args$args";
      }
   }
  
 server {
      listen 81;
      server_name _;

      weserv on;

      location / {
        weserv_mode file;
        
        proxy_pass http://1.1.1.1:80;
      }
    }
}

When we run the follow command on test client, image resizing is not applied. Just original image is downloaded.

$ wget "http://2.2.2.2/test1.jpg?w=300&h=300" -O test1_300.jpg

We want to know how to configure as proxy mode.

Metadata

Assignees

Labels

completedFeature or request has been completedenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions