How to rewrite nginx non-existing file under condition?

Posted by cobra91 on Server Fault See other posts from Server Fault or by cobra91
Published on 2012-03-26T22:54:22Z Indexed on 2012/03/26 23:31 UTC
Read the original article Hit count: 150

Filed under:
|

For a mature website I only need to generate a thumbnail once, using timthumb, which places the thumbnail in /thumbs/.

try_files $uri ^thumbs/(.*)$ /thumb.php?w=290&q=90&src=../full/%1 last;

How could I fix this code?

Working apache code:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^/thumbs/(.*)$
RewriteRule ^(.*)$  /thumb.php?h=90&q=90&src=../full/%1 [NS,L]

Thanks in advance :)

© Server Fault or respective owner

Related posts about nginx

Related posts about rewrite