Welcome! Log In Create A New Profile

Advanced

Does nginx have a directive analogous to Apache's <Directory>?

Juan R. Pozo
October 11, 2012 08:04AM
Hello,

I'm trying to set up an nginx server to replace our current setup
based on Apache. Our users have password protected directories (with
directives in .htaccess files) which we need to keep protected in the
new setup.

As far as I can see, nginx doesn't have a Directory directive, but
only a Location directive, which refers to URIs instead of file system
paths. This means that if a directory is reachable through more than
one URL, I have to include them all in one or more Location
directives. For example:

domain.com, root: /home/user/public_html
sub.domain.com, root: /home/user/public_html/sub

If user protects sub.domain.com/admin (directory
/home/user/public_html/sub/admin) I must make sure that both /admin in
sub.domain.com and /sub/admin in domain.com are protected with the
same password file. I'd rather protect the directory itself, and not
every URL through which visitors can access its contents.

So, does nginx have any mechanism that allows to refer to file system
paths in configuration files, like Apache's <Directory> blocks do?

Thank you.

Regards.
--
Juan R. Pozo - http://html.conclase.net/

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

Does nginx have a directive analogous to Apache's <Directory>?

Juan R. Pozo October 11, 2012 08:04AM

Re: Does nginx have a directive analogous to Apache's <Directory>?

Ensiferous October 11, 2012 04:37PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 259
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