I have some problem with Nginx (set as reverse proxy) in front of Apache. I'm using Apache to serve PHP files and for applying .htaccess rules.
Nginx works but some of the rewrites in .htaccess does not.
I use timthumb.php to manage media like:
/cache/150/100/file.jpg > /media/thumb.php?src=images/file.jpg&w=150&h=100
Rewrite rules works only in PHP application but it doesn't work with above static file. Nginx returns 404 when I try execute my own static rules.
RewriteEngine On
RewriteRule ^cache/([0-9]+)/([0-9]+)/([a-z0-9_\-\.\/]+)$ /media/thumb.php?src=images/$3&w=$1&h=$2 [L]
RewriteRule ^upload/([0-9]+)/([0-9]+)/([a-z0-9_\-\.\/]+)$ /media/thumb.php?src=upload/$3&w=$1&h=$2 [L]
<Files .*>
Order Deny,Allow
Deny From All
</Files>
RewriteRule ^(?:application|modules|system)\b.* index.php/$0 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT]