How to secure an Nginx-based streaming server for RTMP encoding and HLS conversion, allowing playback without a keypass?

I aim to configure a streaming server utilizing RTMP and HLS protocols with Nginx on my Debian VPS. While I’ve managed to set up the basic functionality, a significant security issue remains: unrestricted access allows anyone to stream without requiring a streaming key or password. My goal is to establish a server setup where RTMP encoding and ingestion necessitate a single keypass, followed by conversion to HLS. Additionally, I seek to enable playback without requiring a keypass, utilizing a player like videojs. Any guidance on achieving this setup would be greatly appreciated. Thank you.