Problem editing configuration.yaml for reverse Proxy with Nginx

Hi, I wish I could use my internal url in HA android app. To do this I replaced my current configuration to have https and domain (dnsmasq + duckdns) with nginx and duckdns.
The problem is that if I modify the configuration.yaml file by removing the 2 lines (as would be done, since it is no longer necessary to insert them):

- ssl_certificate: ...
- ssl_key: ...

it works correctly in http with the local ip but not in https with my domain, while if I leave these 2 entries, https works correctly but not http.
I don’t understand where I went wrong …
I have full Home Assistant OS on RPi 3B