Welcome! Log In Create A New Profile

Advanced

Re: Equivalent to "dirname"

merlin corey
December 14, 2009 03:24PM
On Mon, Dec 14, 2009 at 12:09 PM, Pior Bastida <pior@pbastida.net> wrote:
> Hello,
>
> I would like to check if the directory of a non existant file exist.
>
> /mydir/poipoi/foobar    doesn't exist (easy to test)
> /mydir/poipoi/        <-- I need to check that
>
> Basically it would take a "dirname" function.
>
> Can we do that with nginx ?
> Maybe it's over the scope of a webserver...
>
> Thanks !
> --
> Pior Bastida
> pior@pbastida.net
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx
>

Hello,

The rewrite module provides a -d operator to the if directive which
will test for a directory existence; please see
http://wiki.nginx.org/NginxHttpRewriteModule#if .

Alternatively, if you are going to end up using the index or some
value inside the directory if it exists, then you should consider
using the try_files directive documented here:
http://wiki.nginx.org/NginxHttpCoreModule#try_files .

Thanks,
Merlin

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

Equivalent to "dirname"

Pior Bastida December 14, 2009 03:12PM

Re: Equivalent to "dirname"

merlin corey December 14, 2009 03:24PM

Re: Equivalent to "dirname"

Pior Bastida December 14, 2009 04:28PM

Re: Equivalent to "dirname"

merlin corey December 14, 2009 04:54PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 123
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready