S
S
Sergey Vasiliev2021-06-05 23:12:57
Nginx
Sergey Vasiliev, 2021-06-05 23:12:57

Nginx, deny all works strangely. What to do?

Hello fellow people. When such lines are entered into the nginx config, access to all files except .php is restricted. How can I fix it?

location /engine/ {
  deny all;
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vamp, 2021-06-06
@Romo4ka_eto_ia

The regular prefix location has a lower precedence than regular expression locations.
Raise the priority of the deny rule with the ^~ modifier:

location ^~ /engine/ {
    deny all;
}

K
ky0, 2021-06-05
@ky0

Apparently, add a forbidding directive to another location - which processes php files.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question