'Gets list of all \'virtual hosts\' found in Nginx configuration.
Technically this is a misnomer because Nginx does not have virtual
hosts, it has \'server blocks\'.
:returns: List of :class:`~certbot_nginx.obj.VirtualHost`
objects found in configuration
:rtype: list'

def get_vhosts(self):

    enabled = True
    servers = self._get_raw_servers()
    vhosts = []
    for filename in servers:
        for (server, path) in servers[filename]:
            parsed_server = _parse_server_raw(server)
            vhost = obj.VirtualHost(filename, parsed_server['addrs'], parsed_server['ssl'], enabled, parsed_server['names'], server, path)
            vhosts.append(vhost)
    self._update_vhosts_addrs_ssl(vhosts)
    return vhosts
