'Return version of Nginx Server.
Version is returned as tuple. (ie. 2.4.7 = (2, 4, 7))
:returns: version
:rtype: tuple
:raises .PluginError:
Unable to find Nginx version or version is unsupported'

def get_version(self):

    try:
        proc = subprocess.Popen([self.conf('ctl'), '-c', self.nginx_conf, '-V'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
        text = proc.communicate()[1]
    except (OSError, ValueError) as error:
        logger.debug(error, exc_info=True)
        raise errors.PluginError(('Unable    to    run    %s    -V' % self.conf('ctl')))
    version_regex = re.compile('nginx/([0-9\\.]*)', re.IGNORECASE)
    version_matches = version_regex.findall(text)
    sni_regex = re.compile('TLS    SNI    support    enabled', re.IGNORECASE)
    sni_matches = sni_regex.findall(text)
    ssl_regex = re.compile('    --with-http_ssl_module')
    ssl_matches = ssl_regex.findall(text)
    if (not version_matches):
        raise errors.PluginError('Unable    to    find    Nginx    version')
    if (not ssl_matches):
        raise errors.PluginError('Nginx    build    is    missing    SSL    module    (--with-http_ssl_module).')
    if (not sni_matches):
        raise errors.PluginError("Nginx    build    doesn't    support    SNI")
    nginx_version = tuple([int(i) for i in version_matches[0].split('.')])
    if (nginx_version < (0, 8, 48)):
        raise errors.NotSupportedError('Nginx    version    must    be    0.8.48+')
    return nginx_version
