title: How can i get image from another site with nginx for resizing?
body: <p>Hellow!
  I have site <a href="http://example.com" rel="nofollow noreferrer">http://example.com</a> with api /image</p>
  <p>And i have some imagestore on <a href="http://myimagestore.com/my/image/1.jpg" rel="nofollow noreferrer">http://myimagestore.com/my/image/1.jpg</a></p>
  <p>I need to get image from imagestore when anybody call <a href="http://example.com/image" rel="nofollow noreferrer">http://example.com/image</a></p>
  <p>it easy configurated by ngixng like that:</p>
  <pre><code>location = /image {
           rewrite ^ http://myimagestore.com/my/image/1.jpg;
      }
  </code></pre>
  <p>But now i need resize this image.</p>
  <p>For that i'm trying to work with <a href="http://nginx.org/ru/docs/http/ngx_http_image_filter_module.html" rel="nofollow noreferrer">http://nginx.org/ru/docs/http/ngx_http_image_filter_module.html</a> like that:</p>
  <pre><code>location = /image {
      if ($arg_filter = &quot;x200_180&quot;) {
          error_page 418 = @resize_200_180;
          return 418;
      }
  }
  
  location @resize_200_180 {
      image_filter resize 270 -;
      image_filter_buffer 20M;
      image_filter_jpeg_quality 75;
      rewrite ^ http://myimagestore.com/my/image/1.jpg;
  }
  </code></pre>
  <p>But rewrite return 30X with Localion header and <em>image_filter resize</em> can't work with it and return 415. It needs 200 with real content from <a href="http://myimagestore.com/my/image/1.jpg" rel="nofollow noreferrer">http://myimagestore.com/my/image/1.jpg</a></p>
  <p>How can i get it withiut getting real content in the backend of my api?</p>
  <p>Thanks for your attention.</p>