R
R
Roman Nazarkin2015-08-23 21:35:37
Nginx
Roman Nazarkin, 2015-08-23 21:35:37

NGINX Regexp match-anything. How to ask?

Hello!
More recently, when switching from apache to nginx + php-fpm, I encountered the following problem. There is this rewrite rule:

location / {
  rewrite "^/download/([a-zA-Z0-9-=/+]+)_([a-f0-9]{32})/.{3,60}/*$" /index.php?module=download&token=$1&md5=$2;}

As you can see, this condition should work on a URL like:
site.com/download/someTOKEN_md5hash/anything_anything
But! If you set the following URL: site.com/download/someTOKEN_md5hash/anything.zip (i.e. just add a dot, thereby representing it all as a file) - nginx gives a 404 error ..
Everything seems to be true in the regular expression. At least it worked on Apache. Tell me what could be wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dan Ivanov, 2015-08-23
@ptchol

Maybe you have a location with a regular expression that catches all the statics, including zip ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question