I have a server set up with some virtual machines behind a nat. I want to use encryption for my xmpp-server-vm, and therefore need a certificate inside the vm. Is there a possibility to use nginx as a reverse-proxy so i can run letsencrypt and get/renew the certificates on the vm with the xmpp-server and keep the private key on that machine? I can't use nginx as TLS termination proxy because my vm should not have access to the reverse proxy itself, which would be needed because the xmpp-software needs access to the key.
Edit:
I made a schematic of what i want to do:
My basic problem is, i do not know if letsencrypt works behind a reverse proxy with server name indication enabled, so i can get a certificate inside my xmpp-server-vm to encrypt the xmpp traffic.