You lose flexibility though. On the JVM, application containers are basically the same idea, so we started out that way. But the industry arrived at an embedded model, where the application would ship with the servlet engine and be responsible for starting the webserver, so as to be able to control every aspect of the web stack.

Which you'd then promptly put in front of a proxy as you want to handle things like certificates, authentication etc in a different way.

Exactly this