def METHOD_NAME(distribution):
    if distribution != 'fedora':
        apt_install_packages('nginx')
    else:
        dnf_install_packages('nginx')
    _generate_and_install_certificate()
    _configure_nginx()
    if distribution == 'fedora':
        execute_commands_and_raise_on_return_code(
            [
                'sudo restorecon -v /etc/nginx/fact.*',
                'sudo semanage fcontext -at httpd_log_t "/var/log/fact(/.*)?" || true',
                'sudo restorecon -v -R /var/log/fact',
            ],
            error='restore selinux context',
        )
    nginx_process = subprocess.run('sudo nginx -s reload', shell=True, capture_output=True, text=True)
    if nginx_process.returncode != 0:
        raise InstallationError(f'Failed to start nginx\n{nginx_process.stderr}')