It’s part of a community tutorial already
https://dietpi.com/forum/t/how-can-i-secure-connection-to-nextcloud/3820/1