Other people have said lots of useful things so I wanna just add on: nginx proxy manager is really useful for this. It's a webui that automates reverse proxying with Nginx (so that you can host multiple pages on the same machine/port) and also centralizes managing SSL certificates, including automatically obtaining them from Let's Encrypt.
I tried it couple of times when i was less knowledgeable, and failed... i do need to give it another try, but I really struggle focusing on this steps...
It almost makes javascript seem quick and easy hahahah
Yeah setting up a reverse proxy can be confusing, I still struggle with it sometimes. You can get away without it, but when you have your basic setup working then it's great to have.
well...i failed yet again... xD
i was up until 2 am trying tweaking porkbun, cloudflare and nginx proxy manager...
Everything says it's up and running, but i keep getting
" Web server is down Error code 521 "
or
"Hmm. We’re having trouble finding that site."
Now am also late for work and only slept like 5 hours...
and what bugs me the most is that this is just the "testing " setup... when i'll finally get it working i'd have to do it all over again for the main services and private stuff :(