N
N
Nikit_adw2018-02-16 09:43:09
linux
Nikit_adw, 2018-02-16 09:43:09

Add basic auth for specific url?

Good afternoon!
There is a URL - std.freedombay.ru/?p=1
How can I add basic auth to it?
I understand that you need to explicitly specify it in location, but in what place?
location / {
try_files $uri $uri/ =404;
auth_basic "closed site";
auth_basic_user_file .htpasswd;
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
ky0, 2018-02-16
@ky0

You do understand that everything to the right of the question mark is a parameter, not part of the url path, right? That is, all requests like std.freedombay.ru/? will be processed by the / location.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question