Could we perhaps put this in a utility method so that we can use it in other places where we want to do Nginx redirects?