I have a server that is password protected, where I store files that I want my users to be able to access only if they have the rights.
In the NGiNX configs I want to be able to do something like this:
proxy_pass http://username:password@domain:80/
So that a user could go to this address:
http://img.website.com/bob.jpg
And then in the server the configs will point to this address:
http://username:password@domain:80/bob.jpg
Also is there a way to call a script (best would be PHP) to see if the person accessing the file as been logged in.
My sessions are saved on another server (on a Redis DB) so if it is not possible to do it with PHP is there another way?
So how do I configure this?