thank you very much for your help, the problem in HSTS disappeared in nextcloud, only one correction at the end of the code is
systemctl restart nginx
thank you so much @Jappe @MichaIng @Joulinar .
Ah, of course . Great that everything got solved now.