M
M
ML2017-03-02 22:58:59
Nginx
ML, 2017-03-02 22:58:59

Why doesn't Nginx's location regular expression work correctly?

I prescribe
location ~ ^/(page)$
Example:
example.com/page - then page page will be displayed.
And if example.com/dsbfdbdfb - then 404.
That's right.
But if you put a dot at the end .
For example: example.com/page.
Then the page page will be displayed again, and in $requset_uri it will be just / page
How to avoid such garbage?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
Falseclock, 2017-03-05
@Falseclock

Remove brackets and dollar

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question