"alias" directive may not be used inside location given

Denis F. Latypoff latypoff at yandex.ru
Wed Jul 7 16:40:17 MSD 2010


07.07.10, 16:32, "Fernando Perez" <lists at ruby-forum.com>:

> I don't understand the following error:
>  
>  the "alias" directive may not be used inside location given by regular
>  expression
>  
>  >From the docs it seems possible:
>  http://wiki.nginx.org/NginxHttpCoreModule#alias
>  
>  I'm running 0.7.38
>  
>  Here is my conflictual declaration:
>  
>  location ~* ^/uploads/([\w\-\/]+\.(jpg|m4v|mp4|ogv|png)) {
-    alias  $rails_path/uploads/production/$1;
+    root  $rails_path/uploads/production;
+    try_files  /$1 =404;
>  }
>  
>  
>  I want to map the request /uploads/assets/myfile.png to
>  /uploads/production/assets/myfile.png on disk
>  
>  
>  Thanks
>  

-- 
br, Denis F. Latypoff.



More information about the nginx mailing list