trunk-tracking: update from r3852 to r3872

OK, this looks more like it.  Note that major changes are under way to console and static content handling and are expected to land this week (courtesy Josh).  This pull request contains a shim for the first part of this work, but there's going to need to be some concerted work transforming the nginx side to use a real request object in all cases.