location /testfa/ { rewrite ^/testfa/styles/(.+)$ /testfa/templates/styles/$1 last; }
Does this work for you?
my tested virtual>
server { listen ...ip...:80; server_name sub.domain.com; root /usr/local/www/test; error_log /usr/local/www/test/error_debug.log debug; rewrite_log on; location /testfa/ { rewrite ^/testfa/styles/(.+)$ /testfa/templates/styles/$1 last; } }
it works. even the magazine reported:
2011/11/25 01:06:52 [notice] 35208#0: *456705 rewritten data: "/testfa/templates/styles/test.css", args: "", client: IP, server: sub.domain.com, request: "GET /testfa/styles/test.css HTTP/1.1", host: "sub.domain.com"
source share