You need at least PHP 7.2 to encrypt ZIP files with a password.
<?php
$zip = new ZipArchive();
$zipFile = __DIR__ . '/output.zip';Below is a simple nginx configuration file enabling client certificate authentication, i.e. the user/client has to present a certificate in order to get access.
It is the result of a small proof of concept solution for the following task: