Nginx – allow uploads only to authenticated users (nginx + upload_module)

nginx

I have configure Nginx with the upload_module.

I can upload & resume files but anybody can post to the /upload location.

is there a way of making the location /upload internal and use X-Accel-Redirect so that only authenticated users could post files?

Or any idea of how to secure the server so that only certain users could post files, having the authentication logic on the application side?.

Best Answer

You could use nginx's auth_basic, auth_request, or any other authentication method to wrap the /upload location.