I solved the problems reinstalling everything on Debian 9 Stretch:
sudo apt update
sudo apt upgrade -y
sudo shutdown -r now
sudo hostnamectl set-hostname HOSTNAME
sudo sed -i ‘s/^127.0.1.1.*$/127.0.1.1 DOMAIN HOSTNAME/g’ /etc/hosts
sudo apt install -y lua5.1 lua-expat lua-filesystem lua-socket ssl-cert
wget https://packages.prosody.im/debian/pool/main/p/prosody-trunk/prosody-trunk_1nightly747-1~stretch_amd64.deb
sudo dpkg -i prosody-trunk_1nightly747-1~stretch_amd64.deb
chmod +r /etc/prosody/certs/localhost.key
sudo apt install -y nginx
sudo systemctl start nginx.service
sudo systemctl enable nginx.service
sudo apt install -y apt-transport-https
wget -qO - https://download.jitsi.org/jitsi-key.gpg.key | sudo apt-key add -
sudo sh -c “echo ‘deb https://download.jitsi.org stable/’ > /etc/apt/sources.list.d/jitsi-stable.list”
sudo apt update -y
sudo apt install -y jitsi-meet
sudo /usr/share/jitsi-meet/scripts/install-letsencrypt-cert.sh
sudo apt install -y libssl1.0-dev git luarocks lua-bitop
sudo luarocks install luacrypto
sudo luarocks install luajwtjitsi
sudo luarocks install luasec
apt-get install jitsi-meet-tokens
sudo apt install -y ufw
sudo ufw allow OpenSSH
sudo ufw allow http
sudo ufw allow https
sudo ufw allow in 10000:20000/udp
sudo ufw enable
And this is a sample PHP code to generate the token:
// Create token header as a JSON string
$header = json_encode([“kid”=>“jitsi/APP_ID”, ‘typ’ => ‘JWT’, ‘alg’ => ‘HS256’]);
// Create token payload as a JSON string
$payload = json_encode([
“context” => [
“user” => [
“id” => “1”,
“name” => “USERNAME”,
“avatar” => “IMAGE_URL”,
“email” => “EMAIL”
],
“group” => “GROUP”
],
“aud” => “jitsi”,
“iss” => “APP_ID”,
“sub” => “DOMAIN”,
“room” => “*”,
“exp” => 1616078683
]);
// Encode Header to Base64Url String
$base64UrlHeader = str_replace([’+’, ‘/’, ‘=’], [’-’, ‘’, ‘’], base64_encode($header));
// Encode Payload to Base64Url String
$base64UrlPayload = str_replace([’+’, ‘/’, ‘=’], [’-’, '’, ‘’], base64_encode($payload));
// Create Signature Hash
$signature = hash_hmac(‘sha256’, $base64UrlHeader . “.” . $base64UrlPayload, ‘SECRET’, true);
// Encode Signature to Base64Url String
$base64UrlSignature = str_replace([’+’, ‘/’, ‘=’], [’-’, ‘_’, ‘’], base64_encode($signature));
// Create JWT
$jwt = $base64UrlHeader . “.” . $base64UrlPayload . “.” . $base64UrlSignature;
echo $jwt;
I hope this is useful to others.
Bye