<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(11,83,148)"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(11,83,148)">Hi,<br><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(11,83,148)">I'm trying to implement live image resizing on nginx using ngx_http_image_filter_module, and I get some weird issues with it.<br><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(11,83,148)">this is my config for resizing:<br><br>server {<br> listen 1111;<br> server_name localhost;<br> set $backend '<a href="http://bucket.s3.amazonaws.com" target="_blank">bucket.s3.amazonaws.com</a>';<br> resolver 8.8.8.8;<br> resolver_timeout 5s;<br> proxy_buffering off;<br> proxy_http_version 1.1;<br> proxy_pass_request_body off;<br> proxy_pass_request_headers off;<br> proxy_hide_header "x-amz-id-2";<br> proxy_hide_header "x-amz-request-id";<br> proxy_hide_header "x-amz-storage-class";<br> proxy_hide_header "Set-Cookie";<br> proxy_ignore_headers "Set-Cookie";<br> proxy_set_header Host $backend;<br> proxy_method GET;<br> image_filter_interlace on;<br><br> location ~ \/(?<producttitle>.+?)\/(?<ima<wbr>ge>.+?)-W(?<width>(\d+)).(?<<wbr>ext>[a-z_]*) {<br> image_filter resize $width -;<br> proxy_pass http://$backend/$producttitle/<wbr>$image.$ext;<br> error_page 415 = /empty;<br> }<br><br> location = /empty {<br> empty_gif;<br> }<br>}<br><br><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(11,83,148)">and this is my config for caching:<br><br>server {<br> listen 80;<br> server_name <a href="http://images.domain.com" target="_blank">images.domain.com</a>;<br><br> location ~ \/(?<producttitle>.+?)\/(?<ima<wbr>ge>.+?)-W(?<width>(\d+)).(?<<wbr>ext>[a-z_]*) {<br> proxy_pass <a href="http://localhost:1111" target="_blank">http://localhost:1111</a>;<br> proxy_cache mc_images_cache;<br> proxy_cache_key "$host$document_uri$image$widt<wbr>h";<br> proxy_cache_lock on;<br> proxy_cache_valid 200 30d;<br> proxy_cache_valid any 15s;<br> proxy_cache_use_stale error timeout invalid_header updating;<br> proxy_http_version 1.1;<br> expires 30d;<br> }<br><br>}<br><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(11,83,148)">the issue I'm experiencing is getting 415 errors out of no where for some of the width values I provide in the URL.<br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(11,83,148)">sometimes they work and sometimes I get 415.<br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(11,83,148)">nothing informative in debug log.<br><br></div>any idea what I'm doing wrong here?<br><br></div><br>-- <br><div class="gmail_signature"><div dir="ltr"><span style="font-family:courier new,monospace;color:rgb(51,51,51)">Thanks,</span><br style="font-family:courier new,monospace;color:rgb(51,51,51)"><span style="font-family:courier new,monospace;color:rgb(51,51,51)">Benyamin</span><br></div></div>
</div>