On Thu, Oct 16, 2014 at 8:09 PM, igorb <nginx-fo...@nginx.us> wrote:
> I tried to add explicit alias to the regexp location:
>
> server {
>         listen 8080 default_server;
>         root /usr/share/nginx/html;
>         autoindex on;
>
>         location /x/ {
>                 alias /test/;
>         }
>
>         location ~ ^/x/(test.*)$ {
>                 alias /test/$1;
>                 try_files $uri =404;
>         }
> }
>
> However that still gives 404 for localhost/x/test.html . Does that mean that
> try_files cannot be used at all in a regexp location defined with an alias,
> it only works if the location uses the root directive?
>

Why don't just use the alias in try_files?

    try_files /test/$1 =404;

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Reply via email to