For anyone facing the same issue when running nexcloud in docker and behind the reverse proxy,
you can add these lines to your docker-compose:
- OVERWRITECLIURL=https://nextcloud.mydomail.com
- OVERWRITEPROTOCOL=https
this solved the issue for me