It's nice to be able to access your own services when you're on the move. The operation of a publicly accessible Nextcloud installed in the local network can be realized ingeniously simple with a Let's Encrypt certificate and HAProxy on the OPNsense firewall.
Nevertheless: Although this expansion stage is now suitable for public operation, it must be regularly updated and maintained. Nothing is worse than an outdated and therefore vulnerable installation.
Last update:

With this the setup looks now like this:
┌──────────────────────┐ ┌─────────────────────────┐
│ OPNsense │ │ FreeBSD │
│ │ │ ┌─────────────────────┐ │
│ │ │ │ jails/nc │ │
WAN: 0.0.0.0:443 ─┼─► HAProxy:443 ───────┼──► LAN: 0.0.0.0:443 ─┼─┼─► nginx/php │ │
WAN: 0.0.0.0:80 ──┼─► acme.sh:80 │ │ │ │ │ │
└──────────────────────┘ │ │ └─► jail/pgsql │ │
│ │ postgresql │ │
│ └─────────────────────┘ │
└─────────────────────────┘
OPNsense is able to create and automatically renew Let's Encrypt certificates with the ACME client plugin (os-acme-client). The huge advantage is that we have centralised certificate management, do not need to laboriously manage the certificates on each internal target system, and do not need to configure NAT or other firewall settings.
The basic settings described here are sufficient with the following definitions:
HAProxy receives external requests for port 443, encrypts the connection and then forwards it to the internal Nextcloud server on port 443.
The nice thing is that multiple services can be provided simultaneously on port 443. The difference is made via the external host name called up.
This makes it possible, for example, to forward https://nextcloud.domain.de to Nextcloud and https://domain.de to the actual website, even though both actually require port 443 on the same external IP address.
Here you can also go through this article with the following definitions:
Voilá