Unfortunately, if you use nginx for the server in static private files, you are limited to very basic authentication methods, for example:
- Basic auth: from the htpasswd file, which contains a list of users and passwords.
- LDAP auth: create an LDAP directory (this is a third-party module)
However, if your systems store users in a database, nginx does not know how to authenticate users. In addition, if authentication on your system should be combined with authorization , that is, user1 can only access /private/user1/kittenpicture.jpg and user2 /private/user2/nakedpics.jpg , nginx will not help you either, and you there is no other choice but to serve your personal files with nodejs (since then you can combine all kinds of authentication / authorization intermediaries with intermediaries to serve static files.
source share