I've just set up nextcloud according to this guide:
https://www.linuxbabe.com/ubuntu/install-nextcloud-11-ubuntu-16-04-nginx-config
It's on a DigitalOcean VPS and I have the domain name dynamically allocated with a service called duckdns, so that I can reach my nginx webserver by simply typing:
bitofagoob.duckdns.org
Now, I understand how this part works. My VPS is running a script which informs duckdns of which IP address I'm at by pinging it every 10 minutes. When I want access to my VPS I just go via the duckdns service and I'm redirected to the relevant IP, even if it changes.
What I don't understand is how this is now working:
nextcloud.bitofagoob.duckdns.org
^this now gives me my new nextcloud server landing page.
How can a domain be transformed like this? If I think of a domain like this:
Then I am aware that I can control everything to the left of the '@' by adding new users/accounts etc, but how have I just been able to change something to the right of the '@'?