VLANs would be the usual tool for this sort of thing.
I have ports 80 and 443 open on my WAN and forwarded to the server on the LAN. My websites are static (apart from an isso commenting server), so I guess the risk of someone taking control of the server is low... But I'm not sure if that's the right way to do it
I would like to run a website at home but am afraid that due to some programming mistake a hacker takes control of my server and they can access whatever devices I have at home.