I always throw Nginx in front of Node so I can route statics to the filesystem (Don't serve js or CSS through NodeJS), plus it means I can run new NodeJS services and adjust the routing in Nginx to point to them.
Also Fail2Ban reads Nginx logs
Also Fail2Ban reads Nginx logs
It's amazing that this exists, I would have never thought it possible (because of what I saw as inherent limits in what can be expressed in terms of nginx configuration), but now that I see it, of course it is :). From what I gather, custom code can be written as Lua scripts, and many of the modules are written in Lua themselves.
Thank you for sharing this!
Are you building a project (or projects) on OpenResty?
Public Web -> Reverse Proxy -> Application Server
Rather than Public Web -> Nginx -> Node (In his example)
You could reasonably do Public Web -> Node reverse proxy -> Node Application Server
It doesn't really matter if the reverse proxy is Nginx or Node or something else, it's a good pattern to insert a lightweight service at the front which can redirect the requests upstream. If you need to scale by adding new boxes or services, this can now be your load balancer.Your reverse proxy can also handle blocking dodgy requests (Fail2Ban) or act as a lightweight static file handler, leaving your application server to do the grunt work.