Nginx Rewrite Apache?

António P. P. Almeida appa at perusio.net
Tue Apr 12 02:22:04 MSD 2011


On 11 Abr 2011 22h59 WEST, nginx-forum at nginx.us wrote:

> dosen't work
> http://s1.rapidox.pl/QJNqq0821sxz7200DAp0/Si.s_sred.iowi.cze.part5.rar
>
> http://s1.rapidox.pl/files/Si.s_sred.iowi.cze.part5.rar
>
> rewrite >
> rewrite "^[A-Z]{3}[a-z]{2}\d{4}[a-z]{3}\d{4}[A-Z]{2}[a-z]\d/(.+)$"
> files/$1;
>
> i trying this but not work...  rewrite "([A-Z] {3})([a-z] {2})([0-9]
> {4})([a-z] {3})([0-9] {4})([A-Z] {2})([a-z] {1})([0-9] {1})/(.+)$"
> /files/$1 last;
>
> http://pastebin.com/raw.php?i=HZZBStcd

You should use try_files instead of mimicking the dyslexic mod_rewrite
way of doing things with .htaccess. 

location ~* ^.+\.(?:jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|mov|ico){
   access_log off; 
   expires 30d; 
}

try_files $uri $uri/ =404;

Something of that kind.

--- appa




More information about the nginx mailing list