Client certificate auth

I’m running jitsi behind an nginx reverse proxy. I have nginx set up to require client certificates. I’d like to pass the username from the certificate through to prosody for the user authentication. I’m fine configuring prosody to just accept any username (no one has direct access to prosody). I could set a header or cookie in nginx with the username from the cert. Is there some way to configure jitsi to use this for the username?