D
D
Dmitry2019-05-31 16:46:10
Nginx
Dmitry, 2019-05-31 16:46:10

How to do a proper nginx rewrite?

Hello!
There is an nginx rule

rewrite ^(.*)\.(jpe?g|png)$  /index.php?path=$1 last;

How can I pass the file type as the second parameter?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2019-05-31
@muldy

rewrite ^(.*)\.(jpe?g|png)$  /index.php?path=$1&type=$2 last;

Or
rewrite ^(.*\.(jpe?g|png))$  /index.php?path=$1 last;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question