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.

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

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:

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

Sorry, only registered users may post in this forum.

Click here to login

Online Users

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