S
S
Sergey2016-04-14 19:28:28
PHP
Sergey, 2016-04-14 19:28:28

How to disable URL autocorrection in Nginx?

In general, the situation is this, there are folders to which I closed access through Nginx, but one cant surfaced. For example, there is an admin folder, Nginx has a directive that prohibits entering the folder and displays 404, as if it does not exist, when you type site.ru/admin, since this folder exists, Nginx adds a slash at the end, and only then displays 404.
Perhaps but is it possible to disable this autocorrect so that the URL is exactly as it was written? Thanks for any info or answer!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lynn "Coffee Man", 2016-04-14
@Lynn

location = /admin {
    return 404;
}

But the right question is, why is it even in a place accessible to nginx?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question