docs: def loads(data, conf=True):
      """
      Load an nginx configuration from a provided string.
  
      :param str data: nginx configuration
      :param bool conf: Load object(s) into a Conf object?
      """
      f = Conf() if conf else []
      lopen = []
      index = 0
  
      while True:
          m = re.compile(r'^\s*events\s*{', re.S).search(data[index:])
          if m:
              e = Events()
              lopen.insert(0, e)
              index += m.end()
              continue
  
          m = re.compile(r'^\s*http\s*{', re.S).search(data[index:])
          if m:
              h = Http()
              lopen.insert(0, h)
              index += m.end()
              continue
  
          m = re.compile(r'^\s*stream\s*{', re.S).search(data[index:])
          if m:
              s = Stream()
              lopen.insert(0, s)
              index += m.end()
              continue
  
          m = re.compile(r'^\s*server\s*{', re.S).search(data[index:])
          if m:
              s = Server()
              lopen.insert(0, s)
              index += m.end()
              continue
  
          m = re.compile(r'^\s*location\s*([^;]*?)\s*{', re.S).search(data[index:])
          if m:
              l = Location(m.group(1))
              lopen.insert(0, l)
              index += m.end()
              continue
  
          m = re.compile(r'^\s*if\s*([^;]*?)\s*{', re.S).search(data[index:])
          if m:
              ifs = If(m.group(1))
              lopen.insert(0, ifs)
              index += m.end()
              continue
  
          m = re.compile(r'^\s*upstream\s*([^;]*?)\s*{', re.S).search(data[index:])
          if m:
              u = Upstream(m.group(1))
              lopen.insert(0, u)
              index += m.end()
              continue
  
          m = re.compile(r'^\s*geo\s*([^;]*?)\s*{', re.S).search(data[index:])
          if m:
              g = Geo(m.group(1))
              lopen.insert(0, g)
              index += m.end()
              continue
  
          m = re.compile(r'^\s*map\s*([^;]*?)\s*{', re.S).search(data[index:])
          if m:
              g = Map(m.group(1))
              lopen.insert(0, g)
              index += m.end()
              continue
  
          m = re.compile(r'^\s*limit_except\s*([^;]*?)\s*{', re.S).search(data[index:])
          if m:
              l = LimitExcept(m.group(1))
              lopen.insert(0, l)
              index += m.end()
              continue
  
          m = re.compile(r'^\s*types\s*{', re.S).search(data[index:])
          if m:
              l = Types()
              lopen.insert(0, l)
              index += m.end()
              continue
  
          m = re.compile(r'^(\s*)#[ \r\t\f]*(.*?)\n', re.S).search(data[index:])
          if m:
              c = Comment(m.group(2), inline='\n' not in m.group(1))
              if lopen and isinstance(lopen[0], Container):
                  lopen[0].add(c)
              else:
                  f.add(c) if conf else f.append(c)
              index += m.end() - 1
              continue
  
          m = re.compile(r'^\s*}', re.S).search(data[index:])
          if m:
              if isinstance(lopen[0], Container):
                  c = lopen[0]
                  lopen.pop(0)
                  if lopen and isinstance(lopen[0], Container):
                      lopen[0].add(c)
                  else:
                      f.add(c) if conf else f.append(c)
              index += m.end()
              continue
  
          double = r'\s*"[^"]*"'
          single = r'\s*\'[^\']*\''
          normal = r'\s*[^;\s]*'
          s1 = r'{}|{}|{}'.format(double, single, normal)
          s = r'^\s*({})\s*((?:{})+);'.format(s1, s1)
          m = re.compile(s, re.S).search(data[index:])
          if m:
              k = Key(m.group(1), m.group(2))
              if lopen and isinstance(lopen[0], (Container, Server)):
                  lopen[0].add(k)
              else:
                  f.add(k) if conf else f.append(k)
              index += m.end()
              continue
  
          m = re.compile(r'^\s*(\S+);', re.S).search(data[index:])
          if m:
              k = Key(m.group(1), '')
              if lopen and isinstance(lopen[0], (Container, Server)):
                  lopen[0].add(k)
              else:
                  f.add(k) if conf else f.append(k)
              index += m.end()
              continue
  
          break
  
      return f