R
R
RonnyXD2017-02-09 16:52:58
Nginx
RonnyXD, 2017-02-09 16:52:58

NGINX to remove part of the url, just know what should remain?

Good day, please help. There are urls:
/asdas/asdas/cat/loans/express/
/asd/cat/loans/express/ /asasas/asa/aaa/cat/loans /
hypotech
, but everything after /cat/ was saved, thanks in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Evgenievich, 2017-02-09
@banderos120

Well, something like this will happen.

location / {
    rewrite ^(.*)(\/cat\/.*)$ $2 last;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question