Ive recently been wondering if it is possible to reverse proxy a domain to my home server. I’m not exactly sure how reverse proxying tcp works in nginx. And wondered if it is possible at all?

I have a vps with nginx, and want to proxy server.mydomain.com to my home ip address. So if I want to host any game my friends would just enter the address and connect to it. How would that work? And if doesn’t work, what alternatives do I have?

My IP is dynamic and I don’t want a static one. So DNS won’t really work for me