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...@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] >
_______________________________________________ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx