example middleware for working with internal paths in nginx