following symlinks

Igor Sysoev is at rambler-co.ru
Wed Apr 1 19:07:15 MSD 2009


On Wed, Apr 01, 2009 at 10:57:48AM -0400, jackdempsey wrote:

> Thanks Igor, Mike. I've tried the -e flag, and it doesn't seem to follow the symlinks correctly:
> 
>    # check if the file exists and serve it
>     if (-e $request_filename) {
>       access_log        off;
>       expires           1d;
>       break;
>    }
> 
>     # check for an index file, and serve that
>     if (-e $request_filename/index.html) {
>       rewrite (.*) $1/index.html break;
>     }
> 
>     # rails page caching
>     if (-e $request_filename.html) {
>       rewrite (.*) $1.html break;
>     }
> 
>     # route traffic to sae-conf cluster
>     if (!-e $request_filename) {
>       proxy_pass http://site-here;
>       break;
>     }
> 
> When I make the link a hardlink, it does work correctly (with just the -f flag). The -e test should work on 0.6.32, right? Is there anything else I might need to do, any option, compile flag, etc? I can't imagine so, but I'm pretty confident given my local tests that its not working. Anyone have a config with -e working on symbolic links? Maybe its worth putting together a demo site/config myself and seeing if it would work for others. Thanks again for the help.

You should get http://sysoev.ru/nginx/patch.try_files.0.6.35.5
and use

     location / {
         try_files   $uri  $uri/index.html $uri.html  @rails;
     }

     location @rails {
         proxy_pass  http://site-here;
     }


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list