Erik
Erik

Reputation: 14750

What's the best practices to secure nodejs behind nginx when file uploading?

I have NodeJS behind nginx. I need to make possible to upload small files (5-10 mb around) for parsing and handling them. I need to know about possible attack against this feature so basically I'm interested in the following:

  1. What are methods to break server down via unsecure file uploading?
  2. How to prevent that kind of attack and stay server up?
  3. How to configure nginx and nodejs to secure web server?

Upvotes: 0

Views: 389

Answers (1)

Nikolay Lukyanchuk
Nikolay Lukyanchuk

Reputation: 874

  1. Use user authorization for file uploading.

    Or you can see source code of jQuery file uploader for nodejs. It has validation for file types and file size https://github.com/blueimp/jQuery-File-Upload/tree/master/server/node

  2. Use forever (https://github.com/nodejitsu/forever) or other libs to stand up the server

Upvotes: 1

Related Questions