M
M
MaxGoodWork2021-04-15 06:46:18
Nginx
MaxGoodWork, 2021-04-15 06:46:18

Nginx location: how to deny access to a folder?

I know there are many similar questions. But if I need to deny access to the folder and all files in it domen.ru/scripts/php/file.php, making it available only to other PHP scripts, then

location /scripts/php/ {
                deny all;
        }

registered as the first location does not change anything. What can be checked? Naturally rebooted nginx after updating the config.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
ky0, 2021-04-15
@ky0

The order of locations has nothing to do with the sequence of their application, read . Apparently, your requests to scripts are processed in some other, more global config branch.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question