rewrite nginx !

shahzaib mushtaq shahzaib.cb at gmail.com
Wed Dec 12 11:28:17 UTC 2018


Ok, this worked :

rewrite ^/videos/([0-9]+)/(.*)/(.*)/(.*)/([0-9]+)?
https://domain.com/videos/$1/$2 last;

However, if there's any better rule, please let me know.

Regards.


On Wed, Dec 12, 2018 at 3:01 PM shahzaib mushtaq <shahzaib.cb at gmail.com>
wrote:

> Hi,
>
> Need help on constructing the rewrite url in nginx, need to remove last
> two parts of uri as stated in example below:
>
> https://domain.com/videos/32/cooking/most_recent/last_year/
> to
> https://domain.com/videos/32/cooking
>
>
> https://domain.com/videos/17/tv-showbiz/most_recent/today/
> to
> https://domain.com/videos/17/tv-showbiz
>
> Actually we need to match uri as below, help will be highly appreciated :
>
>
> /videos/[ID]/[STRING]/most_recent/[last_year|all_time|videos|this_year|last_week|last_month|today]
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20181212/f2363fdd/attachment.html>


More information about the nginx mailing list