R
R
Rockman2015-04-12 10:56:33
Nginx
Rockman, 2015-04-12 10:56:33

How to write nginx rules correctly?

Tell me how to properly deny access to the entire folder, subfolders and files except for one subfolder.
That is, for example, there is a directory: /folder
There are many folders in it, including the /allow folder.
Access to /folder and all subdirectories except /allow must be denied.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Igor, 2015-04-12
@merryjane

Try to make the maximum match.
Something like this:

location /folder { deny all; }
location /folder/allow { allow all; }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question