I want to install Nextcloud at my home server. The Nextcloud snap will always put the Nextcloud instance at /, let's say https://myserver.ddns.com. But I also want to serve other webpages from my server at https://myserver.ddns.com/otherstuff/, so I'd like to move Nextcloud to https://myserver.ddns.com/nextcloud/.
It seems this can be done for a HTTP server using a reverse proxy with url rewriting, i.e. I run the Nextcloud snap at port 81 and the reverse proxy transparently routes https://myserver.ddns.com/nextcloud/ -> https://myserver.ddns.com:81/.
But I don't want to expose an unencrypted Nextcloud instance to the internet. Is it possible to do this URL rewriting for a HTTPS instance? It would require the proxy to read the HTTPS request, but a transparent reverse proxy shouldn't be able to decrypt the communication?
The alternative is of course a manual install of Nextcloud, but the snap's promise of easier maintenance and configuration written by people who know this stuff better than me is alluring.