<div dir="ltr">Hi,<br><br>Need help on constructing the rewrite url in nginx, need to remove last two parts of uri as stated in example below:<br><br><a href="https://domain.com/videos/32/cooking/most_recent/last_year/">https://domain.com/videos/32/cooking/most_recent/last_year/</a><br>to<br><a href="https://domain.com/videos/32/cooking">https://domain.com/videos/32/cooking</a><br><br><br><a href="https://domain.com/videos/17/tv-showbiz/most_recent/today/">https://domain.com/videos/17/tv-showbiz/most_recent/today/</a><br>to<br><a href="https://domain.com/videos/17/tv-showbiz">https://domain.com/videos/17/tv-showbiz</a><br><br>Actually we need to match uri as below, help will be highly appreciated :<br><br><span style="box-sizing:border-box;margin:0px;padding:0px;vertical-align:baseline;border:0px solid;font-size:14px;color:rgb(51,51,51);font-family:-apple-system,BlinkMacSystemFont,Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI","Segoe UI Emoji","Segoe UI Symbol","Meiryo UI""><code class="gmail-code-colors gmail-inline" style="box-sizing:border-box;margin:0px 0.1em;padding:0px 0.5em;vertical-align:middle;border:1px solid rgb(204,204,204);font-size:13px;display:inline;white-space:pre-wrap;border-radius:4px;font-family:Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-weight:600;direction:ltr;unicode-bidi:embed;background-color:rgb(248,248,248);line-height:16px">/videos/[ID]/[STRING]/most_recent/[last_year|all_time|videos|this_year|last_week|last_month|today]</code></span><input name="virtru-metadata" type="hidden" value="{"email-policy":{"state":"closed","expirationUnit":"days","disableCopyPaste":false,"disablePrint":false,"disableForwarding":false,"enableNoauth":false,"expires":false,"isManaged":false},"attachments":{},"compose-id":"1","compose-window":{"secure":false}}"></div>