Welcome! Log In Create A New Profile

Advanced

Apache Directory equivalent

Posted by aschlosberg 
Apache Directory equivalent
June 06, 2010 09:13AM
I would like to be able to specify directives according to the full Unix path of the files in the same way as I would with Apache. Is this possible in nginx?

Apache e.g.

[code]
<Directory /path/to/my/dir>
AllowOverride None
Order Deny,Allow
Deny from all
</Directory>
[/code]


I am creating a web-based dashboard for my nginx setup and would like to set up http authentication on a per directory basis. The reason that I need to be able to use the full Unix path is that my virtual host serves different roots depending on the HTTP host so using location isn't sufficient.

I considered using if statements but http_auth_basic is only allowed inside location directives:

[code]
location / {
auth_basic "Restricted";
auth_basic_user_file conf/htpasswd;
}
[/code]
Re: Apache Directory equivalent
November 12, 2010 04:07PM
Maybe use the root directive?

http://wiki.nginx.org/HttpCoreModule#root
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 81
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready