January 13, 2017 05:08PM
Hello,

On 01/13/2017 04:42 PM, lacibaci wrote:
> I have a location that I would like to protect:
>
> location /private {
> satisfy any;
>
> allow 192.168.1.0/24;
> deny all;
>
> auth_basic "Protected";
> auth_basic_user_file conf/htpasswd;
> }
>
> This works for /private /private/ and /private/somefile.html
>
> However, when I request (GET or POST) /private/foo.php it will execute
> without auth.
>
> How can I set it up so everything under /private is protected?
>

The request is probably being handled by a different location (ie the
one that handles PHP requests).

See http://nginx.org/en/docs/http/ngx_http_core_module.html#location for
the order in which location is determined.

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

Basic authentication

lacibaci January 13, 2017 04:42PM

Re: Basic authentication

Jim Ohlstein January 13, 2017 05:08PM

Re: Basic authentication

lacibaci January 14, 2017 01:16AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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