Equivalent to "dirname"
merlincorey at dc949.org
Mon Dec 14 23:20:20 MSK 2009
On Mon, Dec 14, 2009 at 12:09 PM, Pior Bastida <pior at pbastida.net> wrote:
> 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 at pbastida.net
> nginx mailing list
> nginx at nginx.org
The rewrite module provides a -d operator to the if directive which
will test for a directory existence; please see
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:
More information about the nginx