           _path: match.path
           target: match.target
           rewrite: (reqUrl)->
+            targetPathBase = if @target.protocol == 'file:'
+              ''
+            else
+              @target.pathname
             if @target.nopath
               @target.pathname
             else if @target.nostrippath

    # Then try the wildcard hostname that would match this
    lookup(proto, host.replace(/^[^\.]+/,""), pathname) ||
    # Then default
    lookup("default:", proto.substring(0,proto.length-1), pathname)

          _path: "/"
          rewrite: (reqUrl)-> 
            targetPathBase = if @target.protocol == 'file:'
              '/'
            else
              @target.pathname
        
