Could you not use htaccess with an Apache reverse proxy? I’ve genuinely no idea but sounds like a common use case.