Is nginx good for dynamic content?

Solution 1:

To be blunt, anyone who runs nginx proxied to Apache (or vice versa) needs their head examined. It doesn't help anything useful, and I wish all the articles recommending it would die in a fire.

That little rant done, nginx is as good for dynamic content as you'd ever want -- it proxies all dynamic content to a backend application server, which is the best model for such things, as it allows the appserver to run as the application user, rather than as the webserver user (which has been a source of much security hilarity over the years). In speed terms it's slightly slower than Apache running mod_php, but not enough that you'll notice (your scripts' runtime will dwarf that of the time added by shunting the request to an appserver).

As far as lighttpd goes, I'd treat as a dead technology. It was great in it's day, but nginx has eaten it's lunch and it's time to let the old gal retire to a quiet pasture.