I'm currently using express-rate-limit
module to block multiple requests from the same ip
or logged in user account in my node server, and this is working pretty good against DoS
attacks. This server is a small local business that requires only one instance, as it doesn't have too many users and it's computing requirements aren't too intensive.
I've been reading a lot about nginx
lately, and many people recommends using it in node servers, but I can't see the major advantages of using it in this kind of application.
How would nginx
be better for my application? What can it do that other npm modules
can't in terms of security for a single server application?
Dedicated reverse proxy tools, like Nginx and HAProxy, typically perform these operations faster than Node. js. Having a web server like Nginx read static content from disk is going to be faster than Node.
Nginx is a web server that can also be used as a reverse proxy, load balancer, mail proxy and HTTP cache. Express is a web application framework for Node. js, released as free and open-source software under the MIT License. It is designed for building web applications and APIs.
NGINX can also buffer any excess requests in a queue and process them promptly. You can enable this behavior in rate-limiting using the burst parameter with the limit_req directive.
You will need Nginx (or Apache) on any scenario. With one server or multiple. Using Express or not. Express is only an application framework to build routes.
Well I am not an NGINX expert but I use NGINX in production currently on my EC2 instance. When it comes to rate limiting there are a couple of options available with respect to express
Lets talk about the second part of your question
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With