Just putting this out there - if like me you're using the default of expressJS - you can add the following middleware in the app.js file:
app.use(function (req, res, next) {
res.locals.req = req;
next();
});
and then in the nunjucks template you can reference it simply by putting {{req.originalUrl}}