Hardening your servers, ensuring proper port exposure, ensuring upgrades and security patches, is thought and time you need to spend. It's hard to keep track of all vulnerabilities in all software. That'd before even talking about zero-downtime deployments and all of that.
Running NGINX and Postgres is not the difficult part that people are avoiding. There's a good reason these services exist.