See
https://manual.calibre-ebook.com/server.html for instructions on how to do reverse proxying with comomn servers. Note that if you want to do auth outside the calibre server, apart from passing the authorization heder, you will also need to mirrors the user accounts in calibre via calibre-server --manage-users