Hi there,<div><br></div><div>we are currently migratiing all services from apache2 to nginx but are currently stuck with a specific rewrite rule.</div><div>The rule in apache is checking if a cached image/thumbnail exists and if so, delivers the output directly.</div>
<div>otherwise it will rewrite the request to an image-processor.</div><div><br></div><div><div> # if cached version exists, output directly</div><div> RewriteCond %{QUERY_STRING} ^(Guest|Member|avatar|tagged|thumb)$</div>
<div> RewriteCond %{DOCUMENT_ROOT}/cache/$1/%{QUERY_STRING}.jpg -f</div><div> RewriteRule (.*)\.jpg$ /cache/$1/%{QUERY_STRING}.jpg [L]</div><div><br></div><div> # otherwise redirect all jpg-image-requests to processing</div>
<div> # script if they are not in cache dir</div><div> RewriteCond %{REQUEST_URI} !^/cache</div><div> RewriteRule \.jpg$ /image_processing.php [QSA,L]</div></div><div><br></div><div>we tried several try_files approaches but we failed so far.</div>
<div>could someone please help in migrating this rewrite rules to nginx?</div><div><br></div><div>Thank you very much!</div><div><br></div><div><div><br></div>-- <br><pre cols="72">Andreas Lehr<br><br><br></pre><br>
</div>